[Python] How to split pandas Series into two based on whether or not the index contains a...

Discussão em 'Python' iniciado por Stack, Setembro 25, 2024.

  1. Stack

    Stack Membro Participativo

    I have pandas series that I want to split into two: one with all the entries of the original series where index contains a certain word and the other with all the remaining entries.

    Getting a series of entries which do contain a certain word in their index is easy:

    foo_series = original_series.filter(like = "foo")


    But how do I get the rest?

    Continue reading...

Compartilhe esta Página