I apologize if my question is rudimentary or has already been answered, I am still very new to programming.
I am trying to write a python scrips to automate the processing of a bunch of .csv files and write the data to different columns depending on which column the ID is on
for example,
import pandas as pd
df = pd.DataFrame({'ID1': ["A12", "A13", "A14"],'Data1': [0,0,0],
'ID2': ["B12", "B13", "B14"],'Data2': [0,0,0],})
giving
ID1 Data1 ID2 Data2
0 A12 0 B12 0
1 A13 0 B13 0
2 A14 0 B14 0
lets say I have the data for B14, I wish for the data to show up in Data2 on the same row as B14. using df.iloc is out of the question because I have around 400 data sets arranges over 8 columns.
my desired results are
ID1 Data1 ID2 Data2
0 A12 0 B12 0
1 A13 0 B13 0
2 A14 0 B14 somedata