【发布时间】:2020-12-02 04:48:42
【问题描述】:
我正在使用这个名为 PyPSA(用于能源系统分析的 Python)的软件。
我正在编写一个小代码来创建用于电力传输的总线。但是,当我使用这个名为.madd() 的特殊函数输入多个值时。 (Network.madd(class_name, names, suffix='', **kwargs)。我得到一个错误。我是python程序的初学者。
n = pypsa.Network()
for i in range(3):
n.madd("Bus","electric bus {}".format(i),v_nom=20, x=x_value, y=y_value)
print(n.buses)
TypeError: Index(...) must be called with a collection of some kind, 'electric bus 0' was passed
【问题讨论】:
标签: python pandas indexing group-by