0

I have a dataframe named df which contains a column named 'Last Updated', so now i want to make a subset named updated_data where i have condition on subset "observations which was Last Updated on 2020-06-13 03:33:14".Help me out to do this. just want to make the subset from this specified time.

i tried this,

updated_data=df[df['Last Updated']== 6/13/2020 03:33:14

but this shows error as

File "", line 1 updated_data=df[df['Last Updated']== 6/13/2020 3:33] ^ SyntaxError: invalid syntax

2
  • 1
    updated_data=df[df['Last Updated']== '6/13/2020 03:33:14']
    – Ami Tavory
    Commented Dec 6, 2021 at 15:55
  • Provide sample data to reproduce the issue Commented Jul 24, 2022 at 10:17

1 Answer 1

0

Just do this

updated_data=df[df['Last Updated']== '6/13/2020 03:33:14']

if it shows you error then try to add the date and time in qoutes

Not the answer you're looking for? Browse other questions tagged or ask your own question.