I have trouble converting the dtype of a column. I am loading a csv file from yahoo finance.
dt = pd.read_csv('data/Tesla.csv')
this gives me the following info:
<class 'pandas.core.frame.DataFrame'>
Int64Index: 923 entries, 0 to 922
Data columns (total 7 columns):
Date 923 non-null object
Open 923 non-null float64
High 923 non-null float64
Low 923 non-null float64
Close 923 non-null float64
Volume 923 non-null int64
Adj Close 923 non-null float64
dtypes: float64(5), int64(1), object(1)
i try to convert the Date into a string but whatever i try it doesn't working. I tried to loop over the row and convert it with str(). I have tried to change the dtype of the object with dt['Date'].apply(str) and I have tried a special dtype object and use that:
types={'Date':'str','Open':'float','High':'float','Low':'float','Close':'float','Volume':'int','Adj Close':'float'}
dt = pd.read_csv('data/Tesla.csv', dtype=types)
But nothing seems to be working.
I use pandas version 0.13.1
objectdtype how variable length strings are represented. What are you actually trying to do?