Skip to content

Commit

Permalink
👽 update code to pandas 2.0
Browse files Browse the repository at this point in the history
- update depreciated functionality in pandas

-> some scripts might have further depreciation warnings
  • Loading branch information
Henry committed Sep 27, 2023
1 parent 25468d2 commit a1dfa2b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion vaep/models/collab.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def combine_data(train_df: pd.DataFrame, val_df: pd.DataFrame) -> Tuple[pd.DataF
Pandas DataFrame of concatenated samples of training and validation data.
Fraction of samples originally in validation data.
"""
X = train_df.append(val_df).reset_index()
X = pd.concat([train_df, val_df]).reset_index()
frac = len(val_df) / (len(train_df) + len(val_df))
return X, frac

Expand Down
6 changes: 4 additions & 2 deletions vaep/tests/test_sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,7 @@ def test_sample_data(random_data):
series_sampled) + len(series_not_sampled)
assert X.index.difference(
series_sampled.index.append(series_not_sampled.index)).empty
assert series_sampled.loc[pd.IndexSlice[:, excluded_feat]].empty
assert not series_not_sampled.loc[pd.IndexSlice[:, excluded_feat]].empty
idx_excluded = series_sampled.index.isin(excluded_feat, level=1)
assert series_sampled.loc[idx_excluded].empty
idx_excluded = series_not_sampled.index.isin(excluded_feat, level=1)
assert not series_not_sampled.loc[idx_excluded].empty

0 comments on commit a1dfa2b

Please sign in to comment.