I have checked the documentation. I don't understand the way to index a Pandas DataFrame.
I would like to divide a DataFrame of stock prices by their respective initial values to index the different stocks to 100. I want to compare their performance. The DataFrame looks like this:
>>> IndexPrices
<class 'pandas.core.frame.DataFrame'>
DatetimeIndex: 157 entries, 1999-12-31 00:00:00 to 2012-12-31 00:00:00
Freq: M
Data columns:
MSCI WORLD :G U$ 148 non-null values
S&P 500 COMPOSITE 148 non-null values
DAX 30 PERFORMANCE 148 non-null values
RUSSELL 2000 148 non-null values
FTSE 100 148 non-null values
US Treasury Bond Yields 30 Year Bond 148 non-null values
dtypes: float64(6)
I have stuff like this, but it's not getting me anywhere.
IndexPrices.divide(IndexPrices[0:1])

所有评论(0)