2020
09-27
09-27
pandas中read_csv、rolling、expanding用法详解
如下所示:importpandasaspdfrompandasimportDataFrameseries=pd.read_csv('daily-min-temperatures.csv',header=0,index_col=0,parse_dates=True,squeeze=True)temps=DataFrame(series.values)width=3shifted=temps.shift(width-1)print(shifted)window=shifted.rolling(window=width)dataframe=DataFrame()dataframe=pd.concat([window.min(),window.mean(),window.max(),temps],axis=1)dataframe.co...
继续阅读 >