Skip to content

Commit

Permalink
Trying to patch travis error
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaCappelletti94 committed Apr 1, 2020
1 parent efeda25 commit e850f17
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions csv_trimming/trim.py
Expand Up @@ -16,7 +16,7 @@ def mask_edges(mask: np.ndarray):
if not val:
break
left += 1
for val in np.flip(mask):
for val in np.flip(mask, axis=0):
if not val:
break
right += 1
Expand All @@ -28,7 +28,7 @@ def _trim_padding(csv: pd.DataFrame) -> pd.DataFrame:
nan_mask = is_na(csv)
rows_threshold = np.logical_not(nan_mask).sum(axis=1).mean()/2
rows_mask = mask_edges(np.logical_not(
nan_mask).sum(axis=1).values < rows_threshold)
nan_mask).sum(axis=1) < rows_threshold)
columns_mask = mask_edges(nan_mask.all(axis=0).values)
return csv[~rows_mask][csv.columns[~columns_mask]]

Expand Down

0 comments on commit e850f17

Please sign in to comment.