Pandas - Sum of multiple specific columns I created this script:
        import pandas as pd
        pd.set_option('display.min_rows', None)
        pd.set_option('display.max_columns', None)
        df = pd.read_excel('file.xlsx', sep=';', skiprows=6)
        df = df.drop(['Position', 'Swap'], axis=1)
        df.drop_duplicates(['Time'])
        df = df.groupby(['Symbol'])[['Profit', 'Volume', 'Commission']].sum()

        df['Comm. ratio'] = (df['Commission'] / df['Profit'])
        df['Comm. ratio'] = df['Comm. ratio'].round(2)
        df['Net profit'] = (df['Profit'] + df['Commission'])
        df.loc['Total'] = pd.Series(df['Commission'].sum(), index = ['Commission'])



    Symbol  Profit Volume Commission Comm. ratio Net profit

    BA
    FB
    NVDA
    US500
    USTEC
    Total                     -45



    df.loc['Total'] = pd.Series(df['Commission'].sum(), index = ['Commission'])

works on &quot;commission&quot; column, but I'd like to have a multiple column sum for &quot;Profit, Commission, and Net profit&quot; in the &quot;Total&quot; row.
I couldn't make it work.
Thanks!
df.loc['Total'] = pd.Series([df['Commission'].sum(),df['Profit'].sum(),df['Net profit'].sum()], index = ['Commission','Profit','Net profit'])