Skip to content

Commit

Permalink
replaced isna with isnull because old pandas complained...
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Schaefer committed Dec 5, 2018
1 parent 795e824 commit 0a84d36
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pandapower/io_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def coords_to_df(value, geotype="line"):
for nr, (x, y) in enumerate(coords):
geo.loc[i, "x%u" % nr] = x
geo.loc[i, "y%u" % nr] = y
elif pd.isna(coords):
elif pd.isnull(coords):
continue
else:
logger.error("unkown format for coords for value {}".format(value))
Expand Down Expand Up @@ -271,7 +271,7 @@ def pp_hook(d):
# coords column is not handled properly when using from_features
if 'coords' in df:
# df['coords'] = df.coords.apply(json.loads)
valid_coords = ~pd.isna(df.coords)
valid_coords = ~pd.isnull(df.coords)
df.loc[valid_coords, 'coords'] = df.loc[valid_coords, "coords"].apply(json.loads)
df = df.reindex(columns=d['columns'])
return df
Expand Down
4 changes: 2 additions & 2 deletions pandapower/plotting/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from matplotlib.patches import Circle, Ellipse, Rectangle, RegularPolygon, Arc, PathPatch
from matplotlib.textpath import TextPath
from matplotlib.transforms import Affine2D
from pandas import isna
from pandas import isnull

try:
import pplog as logging
Expand Down Expand Up @@ -528,7 +528,7 @@ def create_busbar_collection(net, buses=None, infofunc=None, cmap=None, norm=Non
"""

if buses is None:
buses = net.bus_geodata.loc[~isna(net.bus_geodata.coords)].index
buses = net.bus_geodata.loc[~isnull(net.bus_geodata.coords)].index

if cmap is not None:
# determine color of busbar by vm_pu
Expand Down

0 comments on commit 0a84d36

Please sign in to comment.