|
发表于 2016-7-22 10:10:08
|
显示全部楼层
# Set some Pandas options
pd.set_option('display.notebook_repr_html', False)
pd.set_option('display.max_columns', 8)
pd.set_option('display.max_rows', 8)
# construct a DataFrame to demonstrate splitting
# extract from combined the Symbol and AdjClose, and reset the index
vixa = combined[['Symbol', 'Adj Close']].reset_index()
# now, add two columns, year and month, using the year and month
# portions of the data as integers
vixa.insert(1, 'Year', pd.DatetimeIndex(vixa['Date']).year)
vixa.insert(2, 'Month',pd.DatetimeIndex(vixa['Date']).month)
vixa[:5]
|
|
关于我们