Problem with the index attribute of two DataFrame

0

I am loading a pair of data sets, one using DataReader and the other one of a csv downloaded from yahoo finance.

import datetime as dt
import pandas_datareader.data as web
import pandas as pd
import scipy.stats as stats
import matplotlib.pyplot as plt

# Descarga datos de ejemplo
AIG = web.DataReader('AIG', 'morningstar', start = dt.datetime(2011,1,1),end = dt.datetime(2011,12,31))
AIG.reset_index(inplace=True)
AIG.set_index("Date", inplace=True)
SP500 = pd.read_csv('GSPC_2011.csv')
SP500.reset_index(inplace=True)
SP500.set_index("Date", inplace=True)

Up there all right, but I have the problem / problem that .index are different data types, that is:

type(AIG.index)
Out[24]: pandas.core.indexes.datetimes.DatetimeIndex

type(SP500.index)
Out[25]: pandas.core.indexes.base.Index

I would like some advice so that the two (AIG.index and SP500.index) are of the same type of data.

    
asked by robintux 03.07.2018 в 03:26
source

0 answers