示例#1
0
def q02_rename_columns(path):
    "write your solution here"
    df = q01_load_data(path)
    #new_header = df.iloc[1]
    df1 = df.rename(columns={'01 !': 'Gold', '02 !': 'Silver', '03 !':'Bronze'})

    return (df1)
示例#2
0
def q02_rename_columns(path):
    df = q01_load_data(path)
    df.rename(columns={
        '01 !': 'Gold',
        '02 !': 'Silver',
        '03 !': 'Bronze'
    },
              inplace=True)
    return df
示例#3
0
def q02_rename_columns(path):
    "write your solution here"
    df = q01_load_data(path)
    df.rename(columns={
        "01 !": "Gold",
        "02 !": "Silver",
        "03 !": "Bronze"
    },
              inplace=True)
    return df
示例#4
0
def q02_rename_columns(path):
    #"write your solution here"
    df = q01_load_data(path)
    df = df.rename(index=str,
                   columns={
                       "01 !": "Gold",
                       "02 !": "Silver",
                       "03 !": "Bronze"
                   })
    return df
示例#5
0
def q02_rename_columns(path):
    "write your solution here"
    df = q01_load_data(path)
    return df.rename(
        columns={
            '01 !': 'Gold',
            '02 !': 'Silver',
            '03 !': 'Bronze',
            '01 !.1': 'Gold',
            '02 !.1': 'Silver',
            '03 !.1': 'Bronze',
            '01 !.2': 'Gold',
            '02 !.2': 'Silver',
            '03 !.2': 'Bronze',
            'Total.1': 'Total',
        })
示例#6
0
def q02_rename_columns(path):
    'write your solution here'
    df = q01_load_data(path)
    df.columns = ['country name', '# Summer', 'Gold', 'Silver', 'Bronze', 'Total', '# Winter', 'Gold', 'Silver', 'Bronze','Total', '# Games', 'Gold', 'Silver', 'Bronze', 'Combined total']
    return df
def q02_rename_columns(path):
    "write your solution here"
    df = q01_load_data(path)
示例#8
0
def q02_rename_columns(path):
    "write your solution here"
    df = q01_load_data(path)
    
    df = df.rename(columns={'01 !':'Gold','02 !': 'Silver', '03 !': 'Bronze'})
    return df