Issue
I have a column with the weekday, another with the month and another with the year. How do I get the actual date in python?
Solution
import pandas as pd
df = pd.DataFrame({"year": [2018], "month": [12], "day": [1]})
df["date"] = pd.to_datetime(df[["year", "month", "day"]]).dt.date
print(df)
# year month day date
# 0 2018 12 1 2018-12-01
Answered By - Jamie.Sgro
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.