-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 update to make it pandas 2 compatible
- Loading branch information
Henry
committed
May 14, 2024
1 parent
9d4fd08
commit 12f19c5
Showing
3 changed files
with
12 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
import pandas as pd | ||
|
||
import njab | ||
|
||
|
||
def test_thousands_display(): | ||
njab.pandas.set_pandas_options() | ||
s = pd.Series([1_000_000]) | ||
assert str(s)[4:13] == '1,000,000' | ||
|
||
|
||
def test_combine_value_counts(): | ||
df = pd.DataFrame({'a': [1, 2, 2, 2, 3, 3, 3], 'b': [1, 1, 1, 2, 2, 3, 3]}) | ||
exp = {'a': {1: 1, 2: 3, 3: 3}, 'b': {1: 3, 2: 2, 3: 2}} | ||
act = njab.pandas.combine_value_counts(df).to_dict() | ||
assert act == exp |