-
-
Notifications
You must be signed in to change notification settings - Fork 19.1k
Closed
Labels
FrequencyDateOffsetsDateOffsetsMultiIndexNumeric OperationsArithmetic, Comparison, and Logical operationsArithmetic, Comparison, and Logical operationsResampleresample methodresample method
Description
>>> pd.__version__
u'0.17.1'
# Column 1 is a date column, column 0 is a text column representing a stock symbol, column 12 is a price
>>> rawdat = pd.read_csv('./data.csv', parse_dates=[1], index_col=[0, 1], usecols=[0, 1, 12])
# Get monthly change in value for each stock symbol
>>> rawdat.groupby(level=0).pct_change(freq='M')
<Empty>
>>> rawdat.groupby(level=0).pct_change()
<Lots of data>
>>> rawdat.loc[['AAPL']].reset_index(level=0, drop=True).pct_change(freq='M')
<Lots of data>
Metadata
Metadata
Assignees
Labels
FrequencyDateOffsetsDateOffsetsMultiIndexNumeric OperationsArithmetic, Comparison, and Logical operationsArithmetic, Comparison, and Logical operationsResampleresample methodresample method