I just got my hands on pandas and am figuring out how I can read a file. The file is from the WRDS database and is the SP500?constituents?list all the way back to the 1960s. I checked the file and no matter what I do to import it using read_csv
, I still can't display the data correctly.
df = read_csv('sp500-sb.txt')
df
<class 'pandas.core.frame.DataFrame'>
Int64Index: 1231 entries, 0 to 1230
Data columns: gvkeyx ? ? ?from ? ? ?thru ? ? conm
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? gvkey ? ? ?co_conm
...(the column names)
dtypes: object(1)
What does the above chunk of output mean? Anything would be helpful.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…