Skip to content
Advertisement

Pandas data frame only showing one row when it should be showing multiple

My code is

JavaScript

When I run the cell it only presents me with the last item in the table when there are supposed to be 12 items shown. It’s not crucial that I use pandas but I’d like to learn so I’m hoping there’s a fix.

Advertisement

Answer

You had the rows_processed.append(row) outside the for loop, so you were actually just appending the last row. Also pd.DataFrame.from_records could be just pd.DataFrame.

JavaScript
Advertisement