我将一个熊猫数据帧保存为csv文件,如下所示。0 {'word': 5.7}当我尝试读取如下所示的数据帧时,我收到以下错误。df = pd.read_csv('foo.csv', index_col=0, dtype={'str': 'dict'})
TypeError: data type "dict" not understood
我试图使用DataFrame将一个Pandas PyMongo插入到Mongodb中。df.head()因为如果Pandas DataFrame是DatetimeIndex,则将DataFrame转换为dict并将其插入到Mongodb:导致错误:
InvalidDocument: documents must have only string keys, key was