KeyError: "None of [Int64Index([0, 1, 2, 3, 4, 5, 6], dtype='int64')] are in the [index]" while creating bus collections #1205
Unanswered
Prashantgrid
asked this question in
Q&A
Replies: 2 comments 4 replies
-
I am still facing the issue , i tried many things upgrading, downgrdaing pandapower and dependencies, but it is not working. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi,
|
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Dear pandapower community,
I am facing an issue when trying to create a collection of buses. (I do not have the geodata, expecting the fake fake geodata to work)
from pandapower.plotting.plotly import simple_plotly
import pandapower.plotting as plot
import seaborn
import pandapower as pp
import numpy as np
import matplotlib.pyplot as plt
colors=seaborn.color_palette()
net = pp.create_empty_network()
pp.create_bus(net, name = "110 kV bar", vn_kv = 110, type = 'b')
pp.create_bus(net, name = "20 kV bar", vn_kv = 20, type = 'b')
pp.create_bus(net, name = "bus 2", vn_kv = 20, type = 'b')
pp.create_bus(net, name = "bus 3", vn_kv = 20, type = 'b')
pp.create_bus(net, name = "bus 4", vn_kv = 20, type = 'b')
pp.create_bus(net, name = "bus 5", vn_kv = 20, type = 'b')
pp.create_bus(net, name = "bus 6", vn_kv = 20, type = 'b')
pp.create_ext_grid(net, 0, vm_pu = 1)
pp.create_line(net, name = "line 0", from_bus = 1, to_bus = 2, length_km = 1, std_type = "NAYY 4x150 SE")
pp.create_line(net, name = "line 1", from_bus = 2, to_bus = 3, length_km =2, std_type = "NAYY 4x150 SE")
pp.create_line(net, name = "line 2", from_bus = 3, to_bus = 4, length_km = 3, std_type = "NAYY 4x150 SE")
pp.create_line(net, name = "line 3", from_bus = 4, to_bus = 5, length_km = 3, std_type = "NAYY 4x150 SE")
pp.create_line(net, name = "line 4", from_bus = 5, to_bus = 6, length_km = 4, std_type = "NAYY 4x150 SE")
pp.create_line(net, name = "line 5", from_bus = 6, to_bus = 1, length_km = 1, std_type = "NAYY 4x150 SE")
pp.create_transformer_from_parameters(net, hv_bus=0, lv_bus=1, i0_percent=0.038, pfe_kw=11.6,
vkr_percent=0.322, sn_mva=40, vn_lv_kv=22.0, vn_hv_kv=110.0, vk_percent=17.8)
pp.create_load(net, 2, p_mw = 1, q_mvar = 0.2, name = "load 0")
pp.create_load(net, 3, p_mw = 1, q_mvar = 0.2, name = "load 1")
pp.create_load(net, 4, p_mw = 1, q_mvar = 0.2, name = "load 2")
pp.create_load(net, 5, p_mw = 1, q_mvar = 0.2, name = "load 3")
pp.create_load(net, 6, p_mw = 1, q_mvar = 0.2, name = "load 4")
pp.runpp(net)
simple_plotly(net)
bc=plot.create_bus_collection(net, buses=net.bus.index,color="grey",size=50,zorder=1)
lc=plot.create_line_collection(net, lines=net.line.index,color="grey",bus_geodata=None,use_bus_geodata=False,zorder=2)
long_lines=net.line.loc[net.line.length_km>3].index
lcl=plot.create_line_collection(net, lines=long_lines,color=colors[2],bus_geodata=None,use_bus_geodata=False,zorder=2)
plot.draw_collections([lc,bc,lcl])
plt.show()
error:
KeyError: "None of [Int64Index([0, 1, 2, 3, 4, 5, 6], dtype='int64')] are in the [index]"
I tired to give buse sets, but it is not working. Can anyone help me with that? might be I am making some silly mistakes, because it works fine for the overhheim example.
Regards,
Prashant
Beta Was this translation helpful? Give feedback.
All reactions