使用astype()方法:可以通过astype()方法将数据转换为指定的数据类型。
df['column_name'] = df['column_name'].astype('int')使用to_numeric()方法:可以将数据转换为数字类型,如果无法转换则会报错或返回NaN。df['column_name'] = pd.to_numeric(df['column_name'], errors='coerce')使用to_datetime()方法:可以将数据转换为日期时间类型。df['column_name'] = pd.to_datetime(df['column_name'])使用to_timedelta()方法:可以将数据转换为时间间隔类型。df['column_name'] = pd.to_timedelta(df['column_name']) 

