Skip to content

Instantly share code, notes, and snippets.

@tdsmith
Created August 22, 2014 01:58
Show Gist options
  • Save tdsmith/c2e74fcde16daeb9725a to your computer and use it in GitHub Desktop.
Save tdsmith/c2e74fcde16daeb9725a to your computer and use it in GitHub Desktop.
>>> s = pd.Series([0,1,1])
>>> t = pd.Series(['foo', 'bar', 'baz'])
>>> map = pd.Series({0: 'foo', 1: 'bar', 2: 'baz'})
>>> map[s]
0 foo
1 bar
1 bar
dtype: object
>>> map[s].value_counts() - t.value_counts()
bar 1
baz NaN
foo 0
dtype: float64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment