0

So I basically want to read 2 csv files containing with the result: I just want the tables stacked next to each other. I would apreciate some code that would do it for more than 2 csv files.

enter image description here

martineau
  • 99,260
  • 22
  • 139
  • 249
AlinS
  • 21
  • 5
  • Take a look at the [pandas library](https://www.learndatasci.com/tutorials/python-pandas-tutorial-complete-introduction-for-beginners/) and check out [this excellent post](https://stackoverflow.com/questions/53645882/pandas-merging-101). – Gerd Mar 31 '20 at 18:20

1 Answers1

1

Read pandas documentation. It gives all you need to know https://pandas.pydata.org/pandas-docs/stable/user_guide/merging.html

import pandas as pd

df1 = pd.read_csv('a.csv')
df2 = pd.read_csv('b.csv')

print(pd.concat([df1, df2], axis=1, sort=False))
Isuru Dilshan
  • 438
  • 5
  • 14