-
Notifications
You must be signed in to change notification settings - Fork 61
impl loc callable #501
base: master
Are you sure you want to change the base?
impl loc callable #501
Changes from 1 commit
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 |
---|---|---|
|
@@ -1257,6 +1257,23 @@ def test_impl(A): | |
S = pd.Series([2, 4, 6], ['1', '3', '5']) | ||
np.testing.assert_array_equal(hpat_func(S), test_impl(S)) | ||
|
||
@skip_parallel | ||
@skip_sdc_jit('Not impl in old style') | ||
def test_series_loc_callable(self): | ||
def test_impl(S): | ||
return S.loc[(lambda a: a)] | ||
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. Do you exactly need round brackets around of lambda? 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. Maybe to complicate lambda, e.g. |
||
hpat_func = self.jit(test_impl) | ||
S = pd.Series([0, 6, 4, 7, 8], [0, 6, 66, 6, 8]) | ||
pd.testing.assert_series_equal(hpat_func(S), test_impl(S)) | ||
|
||
@unittest.skip('Loc callable return float Series') | ||
def test_series_loc_callable2(self): | ||
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. What do you think about merging of 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. Why not do that? 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. Because implementation has limit and always return float Series. In that case pandas return int Series, and we return float Series. I wrote about it in notes in loc. |
||
def test_impl(S): | ||
return S.loc[(lambda a: a)] | ||
hpat_func = self.jit(test_impl) | ||
S = pd.Series([0, 6, 8, 8, 8], [0, 6, 66, 6, 8]) | ||
pd.testing.assert_series_equal(hpat_func(S), test_impl(S)) | ||
|
||
@skip_sdc_jit('Not impl in old style') | ||
def test_series_at_str(self): | ||
def test_impl(A): | ||
|
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.
Looks like we need to remove the exception raising.