[Python] How can I split a DataFrame column into different columns?

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

  1. Stack

    Stack Membro Participativo

    I have below CSV file

    timestamp,store,customer_name,basket_items,total_price,cash_or_card,card_number
    06/06/2022 09:00,Chesterfield,Stephanie Neyhart,"Large Flat white - 2.45, Large Flavoured iced latte - Vanilla - 3.25, Large Flavoured iced latte - Hazelnut - 3.25",8.95,CASH,


    I want to split basket_items like

    product price
    Large Flat white 2.45
    Large Flavoured iced latte - Vanilla 3.25
    Large Flavoured iced latte - Hazelnut 3.25



    How can I do that with pandas dataframe?

    Continue reading...

Compartilhe esta Página