Hope you can help me. I want to check if a date is valid or not. I've read that I can do this with datetime. My code is:
import pandas as pd
import datetime as dt
df = pd.read_csv("file.csv", encoding="latin1")
dfTest = pd.DataFrame()
dfTest['year'] = df.GEBURTSTAG.dt.year
dfTest['month'] = df.GEBURTSTAG.dt.month
dfTest['day'] = df.GEBURTSTAG.dt.day
dfTest['check'] = dt.datetime(dfTest.year, dfTest.month, dfTest.day)
If I run that code the following TypeError shows up:
cannot convert the series to class 'int'
I can't find the problem.
Thx