【发布时间】:2018-03-20 09:42:42
【问题描述】:
我想将变量中的数据添加到数据框中。我遇到的问题是我需要组织变量,它们没有填充每一行。
我需要数据看起来像这样:
name notification1 notification2 notification3
a 1
b 2
c 3
数据框目前如下所示:
name notification1 notification2 notification3
a 1 1 1
b 2 2 2
c 3 3 3
变量设置如下(所有变量都是str):
notification1 = 1.0
notification2 = 2.0
notification3 = 3.0
person_notification1 = a
person_notification2 = b
person_notification3 = c
每个通知都只附加一个人,因此并非每一行都需要每个人的数据。
提前谢谢你希望我的问题有意义。
【问题讨论】:
-
您用于创建此数据框的代码在哪里?