Hello, I have google searched everything but I still can't find something that fits my needs.
I found this: Combining two csv files using pandas
But it's not doing what I want.
Code
df1 = pd.read_csv("a.csv")
df2 = pd.read_csv("b.csv")
out = df1.append(df2)
with open('main.csv', 'w', encoding='utf-8') as f:
out.to_csv(f, index=False)
a.csv
col1 col2 col3
a b c
d e f
b.csv
col1 col2 col3
g h i
j k l
main.csv It seems to output nicely...
col1 col2 col3
a b c
d e f
g h i
j k l
However, when I try to remove data in a.csv or in b.csv, it seems to remove that specific data in main.csv
Example: a.csv (Removed a,b,c)
col1 col2 col3
d e f
b.csv
col1 col2 col3
g h i
j k l
main.csv
col1 col2 col3
d e f
g h i
j k l
It seems to leave a gap and removes the data if I remove some data in either csv. Basically, a.csv and b.csv is always changing and I want to combine these two without altering the original data that the main.csv have. I would also like that main.csv don't get duplicate rows.