Skip to content

Instantly share code, notes, and snippets.

@FelixChop
Created April 12, 2020 10:10
Show Gist options
  • Select an option

  • Save FelixChop/0709d749b6cf57f4ee51e2b92cef1492 to your computer and use it in GitHub Desktop.

Select an option

Save FelixChop/0709d749b6cf57f4ee51e2b92cef1492 to your computer and use it in GitHub Desktop.
def female_proportion(dataframe):
return (dataframe.Sex=='female').sum() / len(dataframe)
female_proportion(df)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment