Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

=+ Does the job incumbent work outside or in an office setting?

Answered: 1 week ago

Question

How do Excel Pivot Tables handle data from non OLAP databases?

Answered: 1 week ago