I have create a Dataframe from a dictionary like this:
import pandas as pd
data = {'Name': 'Ford Motor', 'AssetType': 'Common Stock', 'Exchange': 'NYSE'}
records = []
statement = {}
for key, value in data.items():
statement = {}
statement[key] = value
records.append(statement)
df = pd.DataFrame(records)
If I do this way, the output look like this:
Name AssetType Exchange
0 Ford Motor NaN NaN
1 NaN Common Stock NaN
2 NaN NaN NYSE
I want the values on the first row and the result look like this:
Name AssetType Exchange
0 Ford Common Stock NYSE
pd.DataFrame(data, index=[0])?AssetTypeto beMotorand not'Common Stock'?