Skip to content

Instantly share code, notes, and snippets.

@piyo7
Created June 22, 2017 09:00
Show Gist options
  • Save piyo7/ed87e829b2c2f816d95645b1640a2ab0 to your computer and use it in GitHub Desktop.
Save piyo7/ed87e829b2c2f816d95645b1640a2ab0 to your computer and use it in GitHub Desktop.
Python Pandasはバッチ処理に向いてない ref: http://qiita.com/piyo7/items/2d4444d3e8e7d385c809
>>> s = pd.Series([0, 1, 2])
>>> s[2]
2
>>> s[1] = np.nan
>>> s[2]
2.0
def do_something(df):
foo = df[['bar', 'baz']] # Is foo a view? A copy? Nobody knows!
# ... many lines here ...
foo['quux'] = value # We don't know whether this will modify df or not!
return foo
*** glibc detected *** /usr/local/anaconda/bin/python: free(): invalid pointer:
Fatal Python error: GC object already tracked
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment