fpath = "datas/beijing_tianqi/beijing_tianqi_2018.csv"
df = pd.read_csv(fpath)
df.loc[:,"bWendu"] = df["bWendu"].str.replace("℃","").astype('int32')
df.loc[:,"yWendu"] = df["yWendu"].str.replace("℃","").astype('int32')
condition = df["ymd"].str.startswith("2018-03")
df_month3 = df[condition].copy()
df_month3["wen_cha"] = df["bWendu"]-df["yWendu"]
print(df_month3.head())
转载请注明原文地址:https://blackberry.8miu.com/read-33660.html