Skip to content

Instantly share code, notes, and snippets.

View joshisa's full-sized avatar
🎯
Focusing

Sanjay Joshi joshisa

🎯
Focusing
View GitHub Profile
@joshisa
joshisa / useful_pandas_snippets.py
Last active August 31, 2015 20:44 — forked from bsweger/useful_pandas_snippets.md
Useful Pandas Snippets
#List unique values in a DataFrame column
pd.unique(df.column_name.ravel())
#Convert Series datatype to numeric, getting rid of any non-numeric values
df['col'] = df['col'].astype(str).convert_objects(convert_numeric=True)
#Grab DataFrame rows where column has certain values
valuelist = ['value1', 'value2', 'value3']
df = df[df.column.isin(value_list)]
@joshisa
joshisa / posts.js
Last active September 24, 2016 10:48 — forked from glennblock/posts.js
Embedded gist syntax for Ghost. Place in ./core/server/api/posts.js.
//the code below will embed replace [gist id=x] tags with an embedded gist similar to the way the Wordpress Gist
//plugin works. I wrote this in order to import posts from Wordpress. See //GB: for the changes.
//SPJ: Updated for compatibility with Ghost 0.6.4
/**
* ### Read
* Find a post, by ID, UUID, or Slug
*
* @public
* @param {{id_or_slug (required), context, status, include, ...}} options
#!/bin/sh
echo "What should the Application be called (no spaces allowed e.g. GCal)?"
read inputline
name=$inputline
echo "What is the url (e.g. https://www.google.com/calendar/render)?"
read inputline
url=$inputline