1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] Create boolean columns from string column

Discussão em 'Python' iniciado por Stack, Abril 12, 2025.

  1. Stack

    Stack Membro Participativo

    I have column column1 of type string with values like "some1,some2,some3". I need to create boolean columns based on column1 like: some1, some2, some3.

    For example, I have the dataframe with one column column1:

    column1 |
    -------------------+
    "some1,some2,some3"|
    "some2,some3" |
    "some1" |
    "some1,some3" |


    I need to get the dataframe with three boolean columns:

    some1 | some2 | some3 |
    ------+-------+-------+
    True | True | True |
    False | True | True |
    True | False | False |
    True | False | True |

    Continue reading...

Compartilhe esta Página