Permalink
Browse files

A few emergency notes, to students and myself

  • Loading branch information...
1 parent d6a41be commit 5cb7cbed14f09d4d93dc739a96d264e979e662fc @brandon-rhodes committed Apr 8, 2015
Showing with 30 additions and 7 deletions.
  1. +25 −7 cheat-sheet.txt
  2. +5 −0 script.txt
View
@@ -17,6 +17,7 @@
3. Start the IPython Notebook and visit the "pandas-tutorial"
folder from inside the .zip
+
len(df) series + value df[df.c == value]
@@ -28,6 +29,12 @@
+ import sys
+ reload(sys)
+ sys.setdefaultencoding('utf-8')
+
+
+
@@ -43,9 +50,14 @@
df.COLUMN series.isnull() df.sort('column')
df['COLUMN'] series.order() df.sort(['column1', 'column2'])
- s.str.len() s.value_counts()
- s.str.contains() s.sort_index() df[['column1', 'column2']]
- s.str.startswith() s.plot(...) df.plot(x='a', y='b', kind='bar')
+s.str.len() s.value_counts() df[['column1', 'column2']]
+s.str.contains() s.sort_index() df.plot(x='a', y='b', kind='scatter')
+s.str.startswith() s.plot(...) df.plot(x='a', y='b', kind='bar')
+
+
+ import sys
+ reload(sys)
+ sys.setdefaultencoding('utf-8')
@@ -56,25 +68,31 @@
df['COLUMN'] series.order() df.sort(['column1', 'column2'])
s.str.len() s.value_counts()
- s.str.contains() s.sort_index() df[['column1', 'column2']]
- s.str.startswith() s.plot(...) df.plot(x='a', y='b', kind='bar')
+ s.str.contains() s.sort_index() df[['column1', 'column2']]
+ s.str.startswith() s.plot(...) df.plot(x='a', y='b', kind='bar')
df.set_index('a').sort_index() df.loc['value']
df.set_index(['a', 'b']).sort_index() df.loc[('v','u')]
df.groupby('column') .size() .mean() .min() .max()
df.groupby(['column1', 'column2']) .agg(['min', 'max'])
+
+
+ "The Pink Panther"
+ brandon@rhodesmill.org
+
+
len(df) series + value df[df.c == value]
df.head() series + series2 df[(df.c >= value) & (df.d < value)]
df.tail() series.notnull() df[(df.c < value) | (df.d != value)]
df.COLUMN series.isnull() df.sort('column')
df['COLUMN'] series.order() df.sort(['column1', 'column2'])
s.str.len() s.value_counts()
- s.str.contains() s.sort_index() df[['column1', 'column2']]
- s.str.startswith() s.plot(...) df.plot(x='a', y='b', kind='bar')
+ s.str.contains() s.sort_index() df[['column1', 'column2']]
+ s.str.startswith() s.plot(...) df.plot(x='a', y='b', kind='bar')
df.set_index('a').sort_index() df.loc['value']
df.set_index(['a', 'b']).sort_index() df.loc[('v','u')]
View
@@ -2,6 +2,10 @@
Session 1
=========
+You should do install if you have not already.
+We have Internet! But, I have USB keys too.
+Format: lesson, exercises, solutions.
+
Open Exercise-1
Point out .from_csv functions
@@ -223,3 +227,4 @@ Thoughts for later
(what pairs of co-stars have appeared the most often together)
Can you use merge to find who was in movies with each other?
+Fix later: second exercise s/hamlet/batman/

0 comments on commit 5cb7cbe

Please sign in to comment.