Skip to content

Commit

Permalink
applying hooks to all dataframe columns
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonRubenDrauz committed Jun 26, 2024
1 parent 2813599 commit d3397dc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pandapower/io_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,11 +577,12 @@ def DataFrame(self):
df.columns.names = column_names

# recreate jsoned objects
for col in ('object', 'controller'): # "controller" for backwards compatibility
if (col in df.columns):
df[col] = df[col].apply(self.pp_hook)
if 'geo' in df.columns:
df['geo'] = df['geo'].dropna().apply(json.dumps).apply(geojson.loads)
dtp = df.dtypes
for col in df.columns:
df[col] = df[col].apply(self.pp_hook)
df = df.astype(dtype = dtp)
return df

@from_serializable.register(class_name='pandapowerNet', module_name='pandapower.auxiliary')#,
Expand Down

0 comments on commit d3397dc

Please sign in to comment.