I imported some timestamps into a Pandas frame (via MongoDBclient ). They relate to microseconds. I would like to circle on the Day. I saw the previous question about using np.round
when converting to int and vice versa, but this does not work (I tried to embed the div on 3600 x 24 x 100000, but this did not work).
I have this pretty simple version, but it seems REALLY ineffective. What I miss in either to_datetime
or in the np.round
example.
df['doa'] = df['doa'].map(lambda x: x.strftime("%Y-%m-%d") pd.to_datetime(df['doa'])
Please note that these are not INDEXES, so I cannot use the frequency trick.
source share