Created
April 19, 2019 15:31
-
-
Save MLWhiz/2389fd65718b5e050726380b8edf4b73 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def wage_split(x): | |
try: | |
return int(x.split("K")[0][1:]) | |
except: | |
return 0 | |
player_df['Wage'] = player_df['Wage'].apply(lambda x : wage_split(x)) | |
def value_split(x): | |
try: | |
if 'M' in x: | |
return float(x.split("M")[0][1:]) | |
elif 'K' in x: | |
return float(x.split("K")[0][1:])/1000 | |
except: | |
return 0 | |
player_df['Value'] = player_df['Value'].apply(lambda x : value_split(x)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment