Merging multiple files in colab

how to merge multiple csv files in the google colaboratory from the pc.i have 12 separate files and want to merge them in a single csv file.

1 Like

You can do so in various ways, one will be to try out using Pandas, using pd.concat()

for that i have to read every file from the pc with pd.read_csv.
i want to extract the files in one csv without calling them individually

Yes, maybe you can do so by looping over all the listed files in the root directory.

list_pd = []
dir = "\directory\"
files = os.listdir(dir)
for file in files:
    list_pd.append(pd.read_csv(dir + file))
3 Likes

import pandas as pd

url = “https://api.covid19india.org/csv/latest/raw_data1.csv

a = pd.read_csv(url)

a