Dec-21-2020, 10:27 PM
I am just getting started on my journey of learning Python and have hit a wall trying to replicate a scenario that I commonly achieve using SAS.
I am reading in a .csv file which contains "Start" and "Complete" dates for projects. Once read in, I need to simply need to calculate the number of business days between the two dates.
Thank you in advance for any help
I am reading in a .csv file which contains "Start" and "Complete" dates for projects. Once read in, I need to simply need to calculate the number of business days between the two dates.
Output:example csv file.
Title Start_Date Complete_Date
----- ---------- -------------
projTitle 1/19/20 1/26/20
projTitle2 2/11/20 2/15/20
Here is what I've done.#read list csv file parse_dates = ['Start_Date', 'Complete_Date'] df = pd.read_csv('sharepoint_requests_tst.csv', parse_dates=parse_dates) #new column for bus day count df['TAT'] = np.busday_count(df['Start_Date'], df['Complete_Date']) Error I get: TypeError: Iterator operand 0 dtype could not be cast from dtype('<M8[ns]') to dtype('<M8[D]') according to the rule 'safe'What am I missing in this logic?
Thank you in advance for any help