In [50]:
%matplotlib inline
import pandas as pd
from ambry.bundle import BuildBundle
import os
b = BuildBundle(os.getcwd())

for p in b.partitions:
    print p.identity

p = b.partitions.all[0]
    
df = p.pandas


livegoode.com-monharc-referrals-0.0.1~p03I001001
livegoode.com-monharc-direferrals-0.0.1~p03I002001

In [51]:
df.head()


Out[51]:
id timestamp last_name first_name grade date_and_time_of_misbehavior location_of_misbehavior documenting_staff_member classroom_or_administrative_managed type_of_misbehavior narrative_description_of_misbehavior consequence reporting_staff_member d12_planning_completed narrative_of_consequence
1 1 2015-01-05 12:56:00.000000 Abdul Sufyan 2 2015-01-05 11:25:00.000000 Blacktop Abdi Administrative Major Defiances (D12) Sufyan was off task during class instruction.... Lunch Detention Ms.Rox A, B, C, D Sufyan receive lunch detention for his action ...
2 2 2014-03-11 10:02:00.000000 Achuoth Riel 4 2014-02-05 11:40:00.000000 PE Alberto Barron Administrative Play fighting (CM), Verbal/Physical Intimidati... student pushed another student in PE and also ... Verbal warning with reminder of positive expec... Mr. Mo A, B, C, D None
3 3 2014-03-03 09:52:00.000000 Achuoth Riel 4 2014-02-21 12:45:00.000000 PE Alberto Barron Administrative Minor Disruptions (CM), Recurring teacher mana... Student was involved in an ongoing problem of ... Verbal warning with reminder of positive expec... Coach Chuy Nunez A, B, C, D All students involved were brought in for medi...
4 4 2014-04-07 10:44:00.000000 Achuoth Riel 4 2014-04-04 09:11:00.000000 4th grade classroom Alberto Barron Administrative Minor Disruptions (CM), Non-compliance/off-tas... Student was upset and not listening to staff w... Verbal warning with reminder of positive expec... Mr. Alfredo A, B, C, D None
5 5 2014-04-16 09:27:00.000000 Achuoth Riel 4 2014-04-15 12:00:00.000000 Yoga Alberto Barron Administrative Minor Disruptions (CM), Non-compliance/off-tas... Throwing markers in a fit, refused to come to ... Verbal warning with reminder of positive expec... Ms. Chandra A, B, C, D None

In [53]:
df.reporting_staff_member.value_counts().to_csv('reporters.csv')

In [46]:
df.grade.hist()


Out[46]:
<matplotlib.axes.AxesSubplot at 0x10c290250>

In [24]:
dt = pd.to_datetime(df.date_and_time_of_misbehavior)

In [30]:
df.date_and_time_of_misbehavior.dt.hour.hist(bins=24)


Out[30]:
<matplotlib.axes.AxesSubplot at 0x10859b090>

In [33]:
df.date_and_time_of_misbehavior.dt.month.hist(bins=12)


Out[33]:
<matplotlib.axes.AxesSubplot at 0x1086323d0>

In [36]:
(df.first_name + " " + df.last_name).value_counts()


Out[36]:
Brianna Walker       31
Lamaryon Shaw        29
Shonti Laster        29
Angel Peterson       23
Abraham Castaneda    21
Tay Tay Achuoth      21
Jaalam Chavez        17
Alex Torres          16
Victor Caperon       16
Riel Achuoth         16
Angel Quezada        14
William Mancilla     13
Benjamin Soto        13
Erick Maceo          12
Vicky Quezada        12
...
Josh Velasquez             1
Michael Lane               1
Elia Moto                  1
Uli Izucar                 1
Javier nelson              1
Anthony Servin             1
Christopher Perez          1
Keenan Gore                1
Jasmine Ramos              1
Adrian Estrada             1
Erendira Narnjo            1
Jacky Loera                1
Gabriel Villa-Cervartes    1
David Carrillo             1
Sedrick LIpscomb           1
Length: 275, dtype: int64

In [ ]: