I Have a dictionary that I want to transform into a pandas dataframe with two columns (value and column name).
mydict = {'government agency': ['FBI', 'CIA','NSA'], 'international organization': ['EU', 'NATO', 'World Bank'], 'company': ['Amazon', 'Google', 'Microsoft']}
mydict=pd.DataFrame(mydict)
I want the table to be formatted like so
Instead of how pandas reads it:
does my dictionary data structure need to be changed or is this something that can be implemented in pandas (i.e. pandas.melt)?