Skip to content

Instantly share code, notes, and snippets.

View alexchen-melbourne's full-sized avatar

alexchen alexchen-melbourne

  • Shanghai;Melbourne
View GitHub Profile
@alexchen-melbourne
alexchen-melbourne / gist:273a90f2fe97cb56e2e6ec95a46cd2e8
Created July 31, 2017 05:03 — 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.
@alexchen-melbourne
alexchen-melbourne / calendar.css
Created February 9, 2017 11:21
Modern Calendar Class written in Php
/*************************** Calendar Top Navigation **************************/
#calendar {
margin: 0px auto;
padding: 0px;
width: 602px;
font-family: Helvetica, "Times New Roman", Times, serif;
}
#calendar .calendar_box {
position: relative;
top: 0px;