may be the answer of this question is available but I could not get proper solution and thus I am looking for the perfect solution. Suppose I have multiple CSV files (around 1500) having single column with some time series data (10,000 times or rows). The column header name is same in all CSV files. Suppose I have CSV files like:
aa1.csv      aa2.csv:      aa3.csv:............aa1500.csv:
datavalue   datavalue      datavalue           datavalue
    4            1             1                  2
    2            3             6                  4
    3            3             3                  8                
    4            4             8                  9
I want the output like this:
datavalue,datavalue,datavalue,datavalue,.....datavalue
4,1,1,..2
2,3,6,..4
3,3,3,..8
4,4,8,..9
My codes are not working and giving something else:
import pandas as pd
import csv
import glob
import os
path 'F:/Work/'
files_in_dir = [f for f in os.listdir(path) if f.endswith('csv')]
for filenames in files_in_dir:
    df = pd.read_csv(filenames)
    df.to_csv('out.csv', mode='a')
If someone can help in this?