我对Pandas颇为陌生,目前在尝试在Dataframe中插入Dataframe时遇到了问题。熊猫:在Dataframe中存储数据帧
我想要做什么: 我有多个模拟和相应的信号文件,我希望它们都在一个大的DataFrame中。所以我想要一个DataFrame,它具有我所有的模拟参数,并且还有我的信号作为嵌套的DataFrame。它应该是这个样子:
SimName | Date | Parameter 1 | Parameter 2 | Signal 1 | Signal 2 |
Name 1 | 123 | XYZ | XYZ | DataFrame | DataFrame |
Name 2 | 456 | XYZ | XYZ | DataFrame | DataFrame |
哪里SimName是我的大数据帧和信号1的每个条目和信号2指数是individuall数据帧。
我的想法是实现这个是这样的:
big_DataFrame['Signal 1'].loc['Name 1']
但是,这导致一个ValueError异常:
Incompatible indexer with DataFrame
是否可以在熊猫这种嵌套DataFrames?
尼科
你应该表现出你的初始数据... – IanS
你是什么意思与初使数据?现在我创建DataFrame并列出所有模拟列表,然后将每个模拟数据添加到另一个 –
为什么要在df中存储df?看看[熊猫小组](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.Panel.html)。 – Parfait