I'm using the free version of canopy v1.4.1. I have similar problem stated in here: http://stackoverflow.com/questions/11361985/output-data-from-all-columns-in-a-dataframe-in-pandas
but instead of getting the information about data frames I'm getting the actual table with the data listed in table:
where I want it to look like:
In [373]: names
Out[373]:
<class 'pandas.core.frame.DataFrame'>
Int64Index: 1690784 entries, 0 to 1690783
Data columns:
name 1690784 non-null values
sex 1690784 non-null values
births 1690784 non-null values
year 1690784 non-null values
dtypes: int64(2), object(2)
My code:
pandas as pd
pieces = [] # create the dictionary for the names
columns = ['name', 'sex', 'births'] # specify the columns names
for year in years:
path = 'yob%d.txt' % year
frame = pd.read_csv(path, names = columns)
frame['year'] = year
pieces.append(frame)
names = pd.concat(pieces, ignore_index = True)
print names