Skip to content

Instantly share code, notes, and snippets.

@Lakshmi-1212
Last active June 5, 2021 18:46
Show Gist options
  • Save Lakshmi-1212/5907030e97ca63a2131ebe031a5513ea to your computer and use it in GitHub Desktop.
Save Lakshmi-1212/5907030e97ca63a2131ebe031a5513ea to your computer and use it in GitHub Desktop.
Merge data and add general statistics
# Combine the batting and bowling dataframes to create a merged players dataframe
players = pd.merge(all_df,batdf, left_index=True, right_index=True,how='outer')
players = pd.merge(players,bowldf, left_index=True, right_index=True,how='outer')
# Number of man of the matches from matches file
players = pd.merge(players,matches['player_of_match'].value_counts(), left_index=True, right_index=True,how='left')
players['player_of_match'] = players[['player_of_match']].fillna(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment