us_census = glob.glob("states*.csv")
df_list = []
for state in us_census:
df_list.append(pd.read_csv(state))
us_census = pd.concat(df_list)
if you look in the navigator, all of the csv files started with “states” so you just glob them all together.
I think your mistake is that you defined “files” at first but then switched to df. if you change "df " to “files”:
then you should have:
files = glob.glob("states*.csv")
df_list =
for filename in files:
data = pd.read_csv(filename)
df_list.append(data)
*files* = pd.concat(df_list)
print(*files*)
I’m sorry if this was confusing, but I hope it helps!