I'm trying to convert a dictionary that only has 1 record to a pandas dataframe. I've used the following code from other solutions:
d = {'id': 'CS2_056', 'cost': 2, 'name': 'Tap'}
pd.DataFrame(d.items(), columns=['id', 'cost','name'])
But I get the following error:
PandasError: DataFrame constructor not properly called!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…