Extracting year from datetime datatypes is giving output as float
问题 I'm a newbee in Pandas. I need your support in a problem i'm facing I have a datatime column in a dataframe and I'm trying to extract the year from it but the output it is giving is in float? fifa['Joined_date'].head() 0 1970-01-01 1 1970-01-01 2 1970-01-01 3 1970-01-01 4 1970-01-01 Name: Joined_date, dtype: datetime64[ns] fifa['Joined_date'].dt.year 0 1970.0 1 1970.0 2 1970.0 3 1970.0 4 1970.0 Name: Joined, Length: 18207, dtype: float64 Output Expected is --> 1970 Can you please help? 回答1: