我在Pandas中有这样一个数据框:
Age InterventionType PrimaryPurpose
0 [Adult, Senior] Device Treatment
1 [Child, Adult, Senior] Drug Basic Science
2 [Adult, Senior] Drug Treatment
3 [Adult, Senior] NaN NaN
4 [Adult, Senior] Other NaN
想以InterventionType为中心,这样我得到:
^{pr2}$我该怎么做?另外,我的数据帧有列表不是标准的吗?如果是这样,什么是一个好的做法“取消名单”的名单?在
假设您的数据帧名为
df
,可以执行以下操作:将返回以下内容
^{pr2}$这是一个多指标的熊猫系列。上面代码中的索引名是“InterventionType”和0,但是这些名称可以很容易地更改。在
相关问题 更多 >
编程相关推荐