【发布时间】:2017-07-09 12:52:42
【问题描述】:
我想向多维 pd.Series 添加行。
b = pd.Series([1,1,2,3], index = [["digit", "digit", "digit", "digit"], ["one", "one", "two", "three"]])
b
Out[30]:
digit one 1
one 1
two 2
three 3
dtype: int64
现在,当我这样做时
b.loc["digit"].loc["four"] = 4
什么都没有发生。没有错误,但 b 保持不变。 虽然这种方法适用于一维系列
【问题讨论】:
标签: python pandas multidimensional-array