Cast pandas column to String

    0

    0

    Javier Pacheco

    This code sets the value of df['column'] to the string 'column'.

    import pandas as pd
    
    df['column'] = df['column'].astype(str)
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.