{"id":7488,"library":"pandapower","title":"pandapower","description":"pandapower is an easy-to-use open-source tool for power system modeling, analysis, and optimization, designed for high automation. As of version 3.4.0, it integrates with pandas for data handling and various solvers for power flow calculations, supporting steady-state analysis, optimal power flow, state estimation, and short-circuit calculations. It maintains a regular release cadence with several updates per year.","status":"active","version":"3.4.0","language":"en","source_language":"en","source_url":"https://github.com/e2nIEE/pandapower","tags":["power systems","electrical engineering","network analysis","power flow","optimization","simulation","smart grid"],"install":[{"cmd":"pip install pandapower","lang":"bash","label":"Latest stable release"},{"cmd":"pip install pandapower[all]","lang":"bash","label":"With all optional dependencies (plotting, converters, etc.)"}],"dependencies":[{"reason":"Required Python version","package":"python","optional":false},{"reason":"Numerical routines for power flow, compatibility with Python 3.10 requires <1.16","package":"scipy","optional":false},{"reason":"Core data structure for networks and results","package":"pandas","optional":false},{"reason":"Optional C++ power flow solver","package":"lightsim2grid","optional":true},{"reason":"Interactive plotting capabilities","package":"plotly","optional":true},{"reason":"Topological graph searches","package":"networkx","optional":true},{"reason":"XML parsing for converters (e.g., CIM)","package":"lxml","optional":true}],"imports":[{"symbol":"pandapower","correct":"import pandapower as pp"},{"note":"While 'from pandapower import networks' works, aliasing to 'nw' is common for brevity and consistency with 'pp'.","wrong":"from pandapower import networks","symbol":"pandapower.networks","correct":"import pandapower.networks as nw"},{"symbol":"pandapower.plotting","correct":"import pandapower.plotting as plot"},{"symbol":"pandapower.diagnostic.diagnostic","correct":"from pandapower.diagnostic import diagnostic"}],"quickstart":{"code":"import pandapower as pp\n\n# Create an empty network\nnet = pp.create_empty_network()\n\n# Create buses\nb1 = pp.create_bus(net, vn_kv=20., name=\"Bus 1\")\nb2 = pp.create_bus(net, vn_kv=0.4, name=\"Bus 2\")\nb3 = pp.create_bus(net, vn_kv=0.4, name=\"Bus 3\")\n\n# Create external grid (slack bus)\npp.create_ext_grid(net, bus=b1, vm_pu=1.02, name=\"Grid Connection\")\n\n# Create load\npp.create_load(net, bus=b3, p_kw=100, q_kvar=50, name=\"Load\")\n\n# Create transformer (using standard type)\npp.create_transformer_from_parameters(net, sn_kva=400., hv_bus=b1, lv_bus=b2, \n                                      vn_hv_kv=20., vn_lv_kv=0.4, vsc_percent=6., \n                                      vscr_percent=1.425, i0_percent=0.3375, \n                                      pfe_kw=1.35, name=\"Trafo\")\n\n# Create a line\npp.create_line(net, from_bus=b2, to_bus=b3, length_km=0.1, std_type=\"NAYY 4x50 SE\")\n\n# Run power flow\npp.runpp(net)\n\n# Print results\nprint(\"Bus Voltage Magnitude (p.u.):\\n\", net.res_bus.vm_pu)\nprint(\"Line Loading (%):\\n\", net.res_line.loading_percent)","lang":"python","description":"This quickstart creates a simple 3-bus network with an external grid, a transformer, a line, and a load. It then runs a power flow calculation and prints the voltage magnitudes for buses and loading percentages for lines. This demonstrates the basic steps of network creation, power flow execution, and result access."},"warnings":[{"fix":"Update plotting code to use `*map` trace names and `layout.map` property. Refer to Plotly's MapLibre migration guide and pandapower's updated plotting documentation.","message":"Plotly plotting functions in pandapower versions >=3.2.0 migrated from Mapbox to MapLibre. This changes internal Plotly trace names (e.g., `scatter_mapbox` to `scatter_map`) and layout properties (`layout.mapbox` to `layout.map`).","severity":"breaking","affected_versions":">=3.2.0"},{"fix":"Adjust code that accesses `net.res_trafo_3ph` or `net.res_line_3ph` to use the new column names (e.g., `pl_a_mw`, `ql_b_mvar`).","message":"In pandapower versions >=3.2.0, the result parameters for three-phase transformers and lines were fixed for consistency. Specifically, `p_a_l_mw` was renamed to `pl_a_mw` (and similar for other phases and `ql` values).","severity":"breaking","affected_versions":">=3.2.0"},{"fix":"Update code that accesses geo-spatial data or interacts with controllers/groups to reflect the new data structure and parameter names (e.g., `net.bus.geo` instead of `net.bus_geodata`). Refer to the 'Update to pandapower 3.0' guide in the documentation.","message":"pandapower 3.0.0 introduced significant changes to geo data storage, moving from dedicated tables (`net.bus_geodata`, `net.line_geodata`) to `geojson` strings stored directly in the element tables (`net.bus.geo`, `net.line.geo`). Additionally, controller and group parameters were renamed for consistency.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Ensure your `scipy` version is compatible. If encountering issues, try pinning `scipy` to a known working version, e.g., `pip install scipy==1.15.0` or `<1.16` for Python 3.10.","message":"Using SciPy versions incompatible with your Python version can cause installation failures or runtime issues. Specifically, Python 3.10 and pandapower versions around 3.3.x might require `scipy < 1.16`.","severity":"gotcha","affected_versions":">=3.0.0, especially Python 3.10 users"},{"fix":"Avoid creating zero-impedance branches. If direct connections without voltage drop are needed, use a `bus-bus` switch instead of a line or transformer with zero impedance.","message":"Branches (lines, transformers) with zero impedance (e.g., `length_km = 0` for lines or `vk_percent=0` for transformers) will lead to non-converging power flow calculations due to infinite admittances.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Use the built-in diagnostic function: `from pandapower.diagnostic import diagnostic; diagnostic(net)` to identify common issues. Check for zero impedance branches, ensure an external grid exists, and verify component parameters.","cause":"Various reasons, including network disconnections, invalid input data (e.g., zero impedance branches), missing external grids, or overloaded components.","error":"Power flow did not converge!"},{"fix":"Access geographical data through the `geo` column in the respective element dataframes (e.g., `net.bus.geo`, `net.line.geo`), which now stores geojson strings.","cause":"Attempting to access old geo data tables (`net.bus_geodata` or `net.line_geodata`) in pandapower versions >=3.0.0 where the geo data structure has changed.","error":"AttributeError: 'pandapowerNet' object has no attribute 'bus_geodata'"},{"fix":"Update pandapower to the latest version (3.4.0 or newer) which includes fixes for these namespace changes. Ensure compatible SciPy and NumPy versions are installed as per pandapower's requirements.","cause":"This error can occur with newer NumPy/SciPy versions due to changes in internal SciPy namespaces, particularly around version 3.4.0 where `scipy.sparse.csc` and `scipy.sparse.csr` were adjusted.","error":"ImportError: cannot import name 'csc_matrix' from 'scipy.sparse'"},{"fix":"Update your plotting calls to use MapLibre-compatible parameters. This includes changing `mapbox_style` to `map_style` and using trace names ending in `_map` instead of `_mapbox`.","cause":"This typically occurs in pandapower versions >=3.2.0 due to the transition of Plotly plotting from Mapbox to MapLibre. Old 'mapbox' related parameters are no longer recognized.","error":"KeyError: 'mapbox' in plotly plotting or map doesn't render"}]}