Skip to content

Commit

Permalink
🎨 rename _flatten_recursively
Browse files Browse the repository at this point in the history
  • Loading branch information
Hi-king committed May 24, 2020
1 parent 22a4a35 commit 73c7ed4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gokart/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,12 @@ def load_data_frame(self,
target: Union[None, str, TargetOnKart] = None,
required_columns: Optional[Set[str]] = None,
drop_columns: bool = False) -> pd.DataFrame:
def _pd_concat(dfs):
def _flatten_recursively(dfs):
if isinstance(dfs, list):
return pd.concat([_pd_concat(df) for df in dfs])
return pd.concat([_flatten_recursively(df) for df in dfs])
else:
return dfs
data = _pd_concat(self.load(target=target))
data = _flatten_recursively(self.load(target=target))

required_columns = required_columns or set()
if data.empty and len(data.index) == 0:
Expand Down

0 comments on commit 73c7ed4

Please sign in to comment.