Parse a Pandas column to Datetime when importing table from SQL database and filtering rows by date

后端 未结 5 866
执念已碎
执念已碎 2020-12-01 09:22

I have a DataFrame with column named date. How can we convert/parse the \'date\' column to a DateTime object?

I loaded the dat

5条回答
  •  离开以前
    2020-12-01 09:59

    You probably need apply, so something like:

    df['date'] = df['date'].apply(dateutil.parser.parse)
    

    Without an example of the column I can't guarantee this will work, but something in that direction should help you to carry on.

提交回复
热议问题