-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: update df.corr, df.cov to be used with more than 30 columns cas…
…e. (#1161) * perf: update df.corr, df.cov to be used with more than 30 columns case. * add large test * remove print * fix_index * fix index * test fix * fix test * fix test * slightly improve multi_apply_unary_op to avoid RecursionError * update recursion limit for nox session * skip the test in e2e/python 3.12 * simplify code * simplify code
- Loading branch information
1 parent
3072d38
commit 9dcf1aa
Showing
6 changed files
with
268 additions
and
54 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
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import sys | ||
|
||
import pandas as pd | ||
import pytest | ||
|
||
|
||
@pytest.mark.skipif( | ||
sys.version_info >= (3, 12), | ||
# See: https://github.com/python/cpython/issues/112282 | ||
reason="setrecursionlimit has no effect on the Python C stack since Python 3.12.", | ||
) | ||
def test_corr_w_numeric_only(scalars_df_numeric_150_columns_maybe_ordered): | ||
scalars_df, scalars_pandas_df = scalars_df_numeric_150_columns_maybe_ordered | ||
bf_result = scalars_df.corr(numeric_only=True).to_pandas() | ||
pd_result = scalars_pandas_df.corr(numeric_only=True) | ||
|
||
pd.testing.assert_frame_equal( | ||
bf_result, | ||
pd_result, | ||
check_dtype=False, | ||
check_index_type=False, | ||
check_column_type=False, | ||
) | ||
|
||
|
||
@pytest.mark.skipif( | ||
sys.version_info >= (3, 12), | ||
# See: https://github.com/python/cpython/issues/112282 | ||
reason="setrecursionlimit has no effect on the Python C stack since Python 3.12.", | ||
) | ||
def test_cov_w_numeric_only(scalars_df_numeric_150_columns_maybe_ordered): | ||
scalars_df, scalars_pandas_df = scalars_df_numeric_150_columns_maybe_ordered | ||
bf_result = scalars_df.cov(numeric_only=True).to_pandas() | ||
pd_result = scalars_pandas_df.cov(numeric_only=True) | ||
|
||
pd.testing.assert_frame_equal( | ||
bf_result, | ||
pd_result, | ||
check_dtype=False, | ||
check_index_type=False, | ||
check_column_type=False, | ||
) |
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