[Python] How to extract City From Purchase Address Column using Python

Discussão em 'Python' iniciado por Stack, Maio 13, 2025.

  1. Stack

    Stack Membro Participativo

    I want to create a new column in df called a city

    This is how the column looks like in df data frame:

    **Purchase Address**
    917 1st St, Dallas, TX 75001
    682 Chestnut St, Boston, MA 0221


    My Expected output should be a new column in df called a city where values between the comma (,) should be in place for example......

    **City**
    Dallas
    Boston

    Continue reading...

Compartilhe esta Página