Skip to content

Instantly share code, notes, and snippets.

View bolshoibooze's full-sized avatar

Arthur Mwai bolshoibooze

View GitHub Profile
@bolshoibooze
bolshoibooze / useful_pandas_recipies.py
Last active November 26, 2016 13:46 — forked from why-not/gist:4582705
Pandas recipe. I find pandas indexing counter intuitive, perhaps my intuitions were shaped by many years in the imperative world. I am collecting some recipes to do things quickly in pandas & to jog my memory.
"""quick way to create a data frame to try things out"""
df = pd.DataFrame(np.random.randn(5, 4), columns=['a', 'b', 'c', 'd'])
df['A'] """ will bring out a col """ df.ix[0] """will bring out a row, #0 in this case"""
"""to get an array from a data frame or a series use values, note it is not a function here, so no parans ()"""
point = df_allpoints[df_allpoints['names'] == given_point] # extract one point row.
point = point['desc'].values[0] # get its descriptor in array form.
@bolshoibooze
bolshoibooze / README.md
Created February 25, 2016 14:58 — forked from gajus/README.md

The issue:

..mobile browsers will wait approximately 300ms from the time that you tap the button to fire the click event. The reason for this is that the browser is waiting to see if you are actually performing a double tap.

(from a new defunct https://developers.google.com/mobile/articles/fast_buttons article)

touch-action CSS property can be used to disable this behaviour.

touch-action: manipulation The user agent may consider touches that begin on the element only for the purposes of scrolling and continuous zooming. Any additional behaviors supported by auto are out of scope for this specification.

@bolshoibooze
bolshoibooze / install scipy & pandas on a virtualenv
Last active March 12, 2016 14:48
Quick install of scipy and pandas on a virtualenv
Bits and pieces i collected while trying to install scipy,numpy and pandas on a VPS (digitalocean):
Scipy has some funny dependencies: http://www.netlib.org/lapack/ and http://www.netlib.org/blas/, so if you want to avoid
the hassle of building BLAS and LAPACK, install linear algebra libraries from repository (for Ubuntu/debian).
# credits:: <http://stackoverflow.com/questions/7496547/does-python-scipy-need-blas>
sudo apt-get install gfortran libopenblas-dev liblapack-dev