KeyError: "None of [Int64Index([ ...] are in the [index]" while plotting a pandapower network

19 Views Asked by At

I am new in pandapower. I wanna plot an IEEE 33 bus network, but i got the following error: my code:

plot.fuse_geodata(net) bc = plot.create_bus_collection(net, net.bus.index, size=.2, color=colors[0], zorder=10) #bc = plot.create_bus_collection(net, nbi, size=.2, color=colors[0], zorder=10) tlc, tpc = plot.create_trafo_collection(net, net.trafo.index, color="g") lcd = plot.create_line_collection(net, net.line.index, color="grey", linewidths=0.5, use_bus_geodata=True) sc = plot.create_bus_collection(net, net.ext_grid.bus.values, patch_type="rect", size=.5, color="y", zorder=11) plot.draw_collections([lcd, bc, tlc, tpc, sc], figsize=(8,6))

the error:

KeyError Traceback (most recent call last) in <cell line: 2>() 1 plot.fuse_geodata(net) ----> 2 bc = plot.create_bus_collection(net, net.bus.index, size=.2, color=colors[0], zorder=10) 3 #bc = plot.create_bus_collection(net, nbi, size=.2, color=colors[0], zorder=10) 4 tlc, tpc = plot.create_trafo_collection(net, net.trafo.index, color="g") 5 lcd = plot.create_line_collection(net, net.line.index, color="grey", linewidths=0.5, use_bus_geodata=True)

9 frames /usr/local/lib/python3.10/dist-packages/pandas/core/indexes/base.py in _raise_if_missing(self, key, indexer, axis_name) 6128 if not self._should_compare(target) and not self._should_partial_index(target): 6129 # _should_partial_index e.g. IntervalIndex with numeric scalars -> 6130 # that can be matched to Interval scalars. 6131 return self._get_indexer_non_comparable(target, method=None, unique=False) 6132

KeyError: "None of [Int64Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,\n 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,\n 33],\n dtype='int64')] are in the [index]"

I wanna see the plot

plotting a pandapower network

0

There are 0 best solutions below