text_html_output_1.png
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

df = pd.read_csv('../input/data.csv')

list(df.columns)

def clean_d(string):
    last_char = string[-1]
    if last_char == '0':
        return 0
    string = string[1:-1]
    num = float(string)
    if last_char == 'K':
        num = num * 1000
    elif last_char == 'M':
        num = num * 1000000
    return num

df['Wage_Num'] = df.apply(lambda row: clean_d(row['Wage']), axis=1)
df.head()