Cleaning US Censor data - inspecting colums

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 = pd.concat(us_census)

This gives me the error:

Traceback (most recent call last):
File “”, line 14, in
AttributeError: ‘list’ object has no attribute ‘columns’

Why can’t it pull any columns? Has the file not been loaded?

  • 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.