Hi!
I am doing the Cleaning US Census Data project and am stuck.
I’m not able to inspect the columns of the us_census data frame using the code below:
files = glob.glob(“file*.csv”)
us_census =
for filename in files:
data = pd.read_csv(filename)
us_census.append(data)
us_census = pd.concat(us_census)
print(us_census.columns())
This gives me the error:
Traceback (most recent call last):
File “script.py”, line 14, in
print(us_census.columns())
AttributeError: ‘list’ object has no attribute ‘columns’
Why can’t it pull any columns? Has the file not been loaded?
Thanks!
- Ian