Skip to content
This repository was archived by the owner on Feb 2, 2024. It is now read-only.

Conversation

densmirn
Copy link
Contributor

@densmirn densmirn commented Dec 2, 2019

No description provided.

make_attribute_wrapper(StringArraySplitViewType, 'data', '_data')


class SplitViewStringMethodsType(types.IterableType):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How this class related to pandas.core.strings.StringMethods? Why we need it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class related to the pandas string methods through existing unit test:

    def test_str_split_filter(self):
        def test_impl(df):
            B = df.A.str.split(',')
            df2 = pd.DataFrame({'B': B})
            return df2[df2.B.str.len() > 1]
        # ...

where split() returns Series with StringArraySplitView. So I made str.len() to work with such data this way. Otherwise we get something like that:
Invalid store of {{i64, i32*, i32*, {i8*, i8*}, i8*}, i8*, {i8*, i64, i32, i32, i64, i8*, i8*}} to {{i64, i64, i32*, i8*, i8*, i8*}, i8*, {i8*, i64, i32, i32, i64, i8*, i8*}}

Made unique names for string methods types
@densmirn densmirn requested a review from shssf December 6, 2019 11:54
Copy link
Collaborator

@AlexanderKalistratov AlexanderKalistratov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@densmirn densmirn merged commit 1513e29 into IntelPython:master Dec 7, 2019
@densmirn densmirn deleted the feature/series_str_len branch June 9, 2020 12:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants