-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
[WIP] Add parameter as_frame to load_data_xxx to return data frames #10972
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ | |
from sklearn.utils.testing import assert_true | ||
from sklearn.utils.testing import assert_equal | ||
from sklearn.utils.testing import assert_raises | ||
from sklearn.utils.testing import SkipTest | ||
|
||
|
||
DATA_HOME = tempfile.mkdtemp(prefix="scikit_learn_data_home_test_") | ||
|
@@ -202,6 +203,15 @@ def test_load_iris(): | |
check_return_X_y(res, partial(load_iris)) | ||
|
||
|
||
def test_load_iris_as_frame(): | ||
try: | ||
data_frame, target_series = load_iris(as_frame=True) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't get why this would raise SkipTest. Why not use importorskip? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. while looking at other fragments of the code i though this was the way to skip the pandas test. let me check importorskip. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. pytest is relatively new to us. But it provides importorskip for this kind of application. |
||
assert_equal(data_frame.shape, (150, 4)) | ||
assert_equal(target_series.shape[0], 150) | ||
except IOError as : | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is invalid syntax. You need to remove |
||
SkipTest("Pandas is needed to run the test") | ||
|
||
|
||
def test_load_wine(): | ||
res = load_wine() | ||
assert_equal(res.data.shape, (178, 13)) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please document the parameter