【发布时间】:2020-06-19 21:51:58
【问题描述】:
我正在尝试创建一个表格,但首先是一个包含表格所需元素的 DF,我收到此错误:
File "<ipython-input-400-241c1509eba9>", line 4, in <module>
[c1.iloc[:,1]],
TypeError: 'module' object is not callable
这是我用来创建新 DF "c1t" 的命令:
c1t = pd({
"Range": ["50-75%", "75-90%", "90-110%",
"110-125%","125-150%"],"adjusted_power": [c1.iloc[:,0]],"counts":
[c1.iloc[:,1]],
}).set_index("Range")
这里是 DF “c1”:
adjusted_power counts
0 (9694.2, 14541.2] 2
1 (14541.2, 17449.5] 3
2 (17449.5, 21327.2] 20
3 (21327.2, 24235.4] 3
4 (24235.4, 29082.5] 1
type(c1)
Out[412]: pandas.core.frame.DataFrame
我认为 DF“c1”是可调用的假设一定是错误的,因为我收到了可调用错误,但我不确定如何为新的 DF (c1t) 包含“c1”。谢谢,
【问题讨论】: