import pandas as pd
from matplotlib import pyplot as plt
from datetime import datetime
filename='sitka_weather_2014.csv'



df=pd.read_csv(filename)
print(df.dtypes)

pandas 强制类型转换 df.astype

df[' Min Humidity']=df[' Min Humidity'].astype('float64')
df=df.astype({'Max Humidity':'float64','Max Dew PointF':'float64'})

print('*'*44)
print(df.dtypes)

pandas 强制类型转换 df.astype

 

相关文章:

  • 2022-12-23
  • 2021-09-28
  • 2021-11-18
  • 2021-11-18
  • 2021-09-04
  • 2022-01-09
  • 2021-06-29
猜你喜欢
  • 2021-11-12
  • 2021-10-02
  • 2022-12-23
相关资源
相似解决方案