|submit_date | approved_date|
------------------------------
|0 1/6/2021 |1/19/2021|
|1 1/5/2021 |1/5/2021|
|2 1/5/2021 |1/5/2021|
|3 1/6/2021 |1/7/2021|
|4 1/7/2021 |1/7/2021|
I uploaded a csv file that has over 200,000 records. using df=pd.read_csv() there are some empty columns and is that okay to fill them with zero? is that why am I getting this error?
date1=pd.Series(df[" Create Date"])
date2=pd.Series(df[" Issue Date"])
date_df = pd.DataFrame(dict(submit_date = date1, approved_date = date2))
date_df
I am able to see the above with this set of code. when I try to calculate the number of dates between the dates. I get "could not convert string to float: '1/6/2021'" when using
(df['Create Date']).apply(lambda x: float(x))
and " cannot convert the series to <class 'float'>" when I try to use below calculation
diff = (float(date1) - float(date2))
diff
can someone please help me to put the code together? Thanks
pd.to_datetime(...)thendf['date1'] - df['date2']