I want to create a 2-dimensional tagged data frame. But I every time get a different error.
I use the data as in the picture. sql server query output
我在下面编写的代码
docs = json.loads(docs)
classes = ['internet', 'arıza', 'kesinti', 'fatura', 'fatura',
'telefon', 'spor', 'ekonomi']
#df_docs = pd.DataFrame({'Dokuman': docs, 'Sinif': classes})
#df_docs= pd.Series([docs, classes], index=['Dokuman','Sinif'])
#df_docs = pd.DataFrame.from_dict(docs)
#df_docs = pd.DataFrame({'Dokuman': docs, 'Sinif': classes})
如何在此处设置数据框?
df_docs = pd.DataFrame({'Dokuman': docs, 'Sinif': classes})
使用此代码时出现错误
最佳答案
the number of records in the docs is not equal to the number of records in the classes, so I am getting the error
问题已改善
关于python - python pd.DataFrame( {'Dokuman' : docs, 'Sinif' : 类}) 中的 Pandas 数据框问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55561799/