Skip to content

Instantly share code, notes, and snippets.

View nuffer's full-sized avatar

Nicolas Uffer nuffer

  • Mycosense SA
  • Lausanne, Switzerland
  • 16:44 (UTC -12:00)
View GitHub Profile
@nuffer
nuffer / useful_pandas_snippets.py
Created December 11, 2017 16:20 — forked from bsweger/useful_pandas_snippets.md
Useful Pandas Snippets
# List unique values in a DataFrame column
# h/t @makmanalp for the updated syntax!
df['Column Name'].unique()
# Convert Series datatype to numeric (will error if column has non-numeric values)
# h/t @makmanalp
pd.to_numeric(df['Column Name'])
# Convert Series datatype to numeric, changing non-numeric values to NaN
# h/t @makmanalp for the updated syntax!
@nuffer
nuffer / dummy-web-server.py
Created February 13, 2018 21:22 — forked from bradmontgomery/dummy-web-server.py
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python.
Usage::
./dummy-web-server.py [<port>]
Send a GET request::
curl http://localhost