Cleaning US Censor data - inspecting colums

Hi!
I am doing the Cleaning US Census Data project and am stuck. I don
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

Welcome to the forum, @jewsnackman.

It’s unclear where your indentations are, thus it appears you appended data to us_census, then concatenated it with nothing. It would be helpful for troubleshooting if you post your code inside the preformatted text area (use </>). A link to the lesson may also help.

See this link for hints on asking questions.