I'm still relatively new to python. I want to iterate through two folders (there are multiple files in them) and then place the output in two dataframes.
This is what I have so far
code:
import pandas
import os
def iterate(folder_path,folder_path2):
i = 1
os.chdir(folder_path)
os.chdir(folder_path2)
for (filename,filename2) in os.listdir(folder_path,folder_path2):
df1 = pd.read_csv(filename, header=None)
df2 = pd.read_csv(filename2, header=None)
iterate('folder_path', 'second_folder_path')
As you probably know, this does not work.
Is there something I'm missing or another way to fix it?