I'm passing chunks of 1,000 rows and merging them within a pandas dataframe but the merged dataframe isn't saved and there's a new datagframe output each time. How can I save the merge each iteration?
def mergeDFs:
def merge(x):
df = df.merge(x, left_on="id", right_on="id")
reader = pd.read_csv("train_lag.csv", chunksize=1000)
for r in reader:
merged = merge(r)
return merged