I have a dataset with some incomplete dates. I.e., while the default is "2020-03-20" some dates only have the year (i.e. 2020).
In these cases (year only) it seems like pd.DatetimeIndex(["2020"]).month[or day]
sets the month and day to 01-01 automatically to 01. I'd rather have it return a NaN instead. I feel like this should be fairly easy to do, but I can't seem to find a way via Google. Any pointers on how to solve this would be greatly appreciated.
Is there maybe a way to identify "year only"
dates easily so I can skip them when calculating the months?
Thanks!