Question
I have a csv file with a column that are dates. I need to run each date and determine whether or not it is a
I have a csv file with a column that are dates. I need to run each date and determine whether or not it is a US Federal Holiday using the Pandas DF. I need to determine if it is a US Federal Holiday and assign it a numeric value. Apparently the pandas DF has 12 federal holidays. If the holiday is the 5th holiday in the year, I need to assign a new value of 5 in a new column.
How do I detect if a date is a US holiday and how do I determine its position? I know how to read in dates (a for loop) and I know how to add each numeric value to a new column. But how do i determine if its a holiday using "from pandas.tseries.holiday import USFederalHolidayCalendar?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started