Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How can I use "for loop" to output dataframe in order?

I want to output dataframes with for loop.

For example, a list (it is just a metaphor)

a=[1, 2, 3, 4]

for i in range(3):
   a[i]

Like this, I want to output "dataframes" in order with for loop. Can I do it? How can I do this?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Since there are no sample dataframes you have provided and assuming you want to just print(output) them. The same methodology could be applied.

Store all the dataframe identifiers in a list and print them using for loop. Here df[s] represent 3 separates dataframe.

lis = [df,df1,df2]
for i in lis:
   print(i)
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading