Skip to content
Advertisement

How to return appended data frame using a function in Python?

I would like to return each data frame from each URL appended into one single data frame. When I print it within the function, I get the result I desire. The problem is when I try assign a variable to the data frame, it only adds the final data frame. Running this function prints my desired result:

JavaScript

But when I try to assign it a value, it only prints the final data frame, instead of all of them together.

JavaScript

How can I append each data frame into one, and name that new data frame as a variable? Please help, thanks!

Advertisement

Answer

Try creating an empty list to append to and then concat

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement