I created a dataframe from CSV’s where I had the date in milis. I managed to turn this into a date, exactly what I want. However, when I try to create a new dataframe with a seperate date, this does not work. I use the standard .loc for pandas as was recommended on this site.
I have the following code:
samen['timestamp'] = pd.to_datetime(samen['timestamp'], unit='ms')
samen['timestamp'] = samen['timestamp'].dt.date
dag1 = samen.loc[samen["timestamp"] == "2019-05-08" ]
dag1
However, when I use this code, it returns an empty dataframe. I am not sure where the fault lies.
New contributor
tomas Meeuwse is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.