I'm not sure what the technical name of the desired operation is, but I have data in the following format where my field names are a column and the corresponding values are a column. Currently, I filtered a new df to each field name and then concat all three back together which is clunky and not ideal (I'm sure there is a better way).
dummy_data = {
'Field_Names': ['Field_1','Field_2','Field_3','Field_1','Field_2','Field_3'],
'Field_Values': ['Bob','John','Kyle','Eric','Pat','Rana']
}
dummy_df = pd.DataFrame(dummy_data)
I would like the field names to be their own columns. Desired output is below:
details = {'Field_1': ['Bob', 'Eric'],
'Field_2': ['John', 'Pat'],
'Field_3': ['Kyle', 'Rana']}
desired_output = pd.DataFrame(details)
print(desired_output)
There is likely a pandas method for this but again, I'm not sure what the technical name is for the operation I'm looking to perform. I am using Python 3.7+ in Jupyter on Windows.