I have multiple csv files, lets say a.csv , b.csv . I want both a.csv and b.csv in a new c.csv . Both new csv should be in tabs inside as it is. I just want to add both csv in tabs . Is there any short way doing that in pandas. I have the below code with me but its not giving any output ,however its executing . Tried checking few posts in stackoverflow but somehow I did not got the wanted output. Please help me with some better solution.
folders=next(os.walk('.'))[1]
for host in folders:
Path=os.path.join(os.getcwd(),host)
all_files = glob.glob(os.path.join(Path, "*.csv"))
df_from_each_file = (pd.read_csv(f) for f in all_files)
df = pd.concat(df_from_each_file, ignore_index=True)
df.to_csv('c.csv,' index=False)