pandas icon indicating copy to clipboard operation
pandas copied to clipboard

ValueError: Could not convert object to NumPy datetime

Open Supriyapattar123 opened this issue 2 years ago • 1 comments

Research

  • [X] I have searched the [pandas] tag on StackOverflow for similar questions.

  • [X] I have asked my usage related question on StackOverflow.

Link to question on StackOverflow

ValueError Traceback (most recent call last) in 33 vac_strt_end = [vdf.loc[vdf['CAREGIVERID'] == cg]["START_DATE"], vdf.loc[vdf['CAREGIVERID'] == cg]["END_DATE"]] 34 if not(vac_strt_end[0].empty) and not(vac_strt_end[1].empty) : ---> 35 vac_days = np.arange(vac_strt_end[0], vac_strt_end[1], dtype = 'datetime64[D]') 36 for d in np.union1d( schedule_days, vac_days): 37 idx = np.where(d = schedule_days)[0] ValueError: Could not convert object to NumPy datetime

Question about pandas

ValueError Traceback (most recent call last) in 33 vac_strt_end = [vdf.loc[vdf['CAREGIVERID'] == cg]["START_DATE"], vdf.loc[vdf['CAREGIVERID'] == cg]["END_DATE"]] 34 if not(vac_strt_end[0].empty) and not(vac_strt_end[1].empty) : ---> 35 vac_days = np.arange(vac_strt_end[0], vac_strt_end[1], dtype = 'datetime64[D]') 36 for d in np.union1d( schedule_days, vac_days): 37 idx = np.where(d = schedule_days)[0]

ValueError: Could not convert object to NumPy datetime

Supriyapattar123 avatar Sep 21 '22 11:09 Supriyapattar123

Hi - please post a reproducible example, see

https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports

for how

MarcoGorelli avatar Sep 21 '22 11:09 MarcoGorelli

closing, will reopen if you address the above

MarcoGorelli avatar Sep 22 '22 11:09 MarcoGorelli