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
Get step-by-step solutions from verified subject matter experts
