Column Division

    0

    0

    Mahendra Kumar

    pythonPandaslogic

    Dividing Two Columns using Python Pandas

    # import pandas
    import pandas as pd
    # take inputs
    df = pd.DataFrame({'column1':[4,9,10,15], 'column2':[2,3,5,15]})
    # divide columns
    df['division'] = df['column1'] / df['column2']
    # print division value
    print(df)
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Explore
    • Cookbooks
    • Playground
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.