Thanks to visit codestin.com
Credit goes to github.com

Skip to content

TST Fixes test so that whole test isn't skipped if pandas not… #16627

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 4, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion sklearn/compose/tests/test_column_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,7 @@ def test_column_transformer_no_estimators_set_params():


def test_column_transformer_callable_specifier():
# assert that function gets the full array / dataframe
# assert that function gets the full array
X_array = np.array([[0, 1, 2], [2, 4, 6]]).T
X_res_first = np.array([[0, 1, 2]]).T

Expand All @@ -1055,7 +1055,13 @@ def func(X):
assert callable(ct.transformers[0][2])
assert ct.transformers_[0][2] == [0]


def test_column_transformer_callable_specifier_dataframe():
# assert that function gets the full dataframe
pd = pytest.importorskip('pandas')
X_array = np.array([[0, 1, 2], [2, 4, 6]]).T
X_res_first = np.array([[0, 1, 2]]).T

X_df = pd.DataFrame(X_array, columns=['first', 'second'])

def func(X):
Expand Down