CoCalc Shared Files341fa17 / igc_results / subsetting-dataframe.ipynbOpen in CoCalc with one click!
Author: s singlet
Views : 9
In [3]:
import numpy as np import pandas as pd df = pd.read_csv('R_from_PV_data.csv') # get experimentor's names df.Experimentors.unique()
array(['Liz & Jake', 'Sam, Natalya, Christina, Hanna', 'Isabel, Heather, Jeff', 'Marissa, Jordyn '], dtype=object)
In [6]:
# subset one group's work df[df.Experimentors=="Isabel, Heather, Jeff"]
Experimentors R values Units
23 Isabel, Heather, Jeff 0.078 L*atm/mol*K
24 Isabel, Heather, Jeff 0.081 L*atm/mol*K
25 Isabel, Heather, Jeff 0.081 L*atm/mol*K
26 Isabel, Heather, Jeff 0.081 L*atm/mol*K
27 Isabel, Heather, Jeff 0.082 L*atm/mol*K
28 Isabel, Heather, Jeff 0.083 L*atm/mol*K
29 Isabel, Heather, Jeff 0.082 L*atm/mol*K
30 Isabel, Heather, Jeff 0.082 L*atm/mol*K
31 Isabel, Heather, Jeff 0.083 L*atm/mol*K
32 Isabel, Heather, Jeff 0.083 L*atm/mol*K
33 Isabel, Heather, Jeff 0.084 L*atm/mol*K
34 Isabel, Heather, Jeff 0.085 L*atm/mol*K
46 Isabel, Heather, Jeff 0.065 L*atm/mol*K
47 Isabel, Heather, Jeff 0.078 L*atm/mol*K
48 Isabel, Heather, Jeff 0.083 L*atm/mol*K
49 Isabel, Heather, Jeff 0.083 L*atm/mol*K
50 Isabel, Heather, Jeff 0.084 L*atm/mol*K
51 Isabel, Heather, Jeff 0.084 L*atm/mol*K
52 Isabel, Heather, Jeff 0.084 L*atm/mol*K
53 Isabel, Heather, Jeff 0.084 L*atm/mol*K
54 Isabel, Heather, Jeff 0.085 L*atm/mol*K
55 Isabel, Heather, Jeff 0.085 L*atm/mol*K
56 Isabel, Heather, Jeff 0.085 L*atm/mol*K
57 Isabel, Heather, Jeff 0.086 L*atm/mol*K
In [8]:
# save the group data to variable heather = df[df.Experimentors=="Isabel, Heather, Jeff"] heather
Experimentors R values Units
23 Isabel, Heather, Jeff 0.078 L*atm/mol*K
24 Isabel, Heather, Jeff 0.081 L*atm/mol*K
25 Isabel, Heather, Jeff 0.081 L*atm/mol*K
26 Isabel, Heather, Jeff 0.081 L*atm/mol*K
27 Isabel, Heather, Jeff 0.082 L*atm/mol*K
28 Isabel, Heather, Jeff 0.083 L*atm/mol*K
29 Isabel, Heather, Jeff 0.082 L*atm/mol*K
30 Isabel, Heather, Jeff 0.082 L*atm/mol*K
31 Isabel, Heather, Jeff 0.083 L*atm/mol*K
32 Isabel, Heather, Jeff 0.083 L*atm/mol*K
33 Isabel, Heather, Jeff 0.084 L*atm/mol*K
34 Isabel, Heather, Jeff 0.085 L*atm/mol*K
46 Isabel, Heather, Jeff 0.065 L*atm/mol*K
47 Isabel, Heather, Jeff 0.078 L*atm/mol*K
48 Isabel, Heather, Jeff 0.083 L*atm/mol*K
49 Isabel, Heather, Jeff 0.083 L*atm/mol*K
50 Isabel, Heather, Jeff 0.084 L*atm/mol*K
51 Isabel, Heather, Jeff 0.084 L*atm/mol*K
52 Isabel, Heather, Jeff 0.084 L*atm/mol*K
53 Isabel, Heather, Jeff 0.084 L*atm/mol*K
54 Isabel, Heather, Jeff 0.085 L*atm/mol*K
55 Isabel, Heather, Jeff 0.085 L*atm/mol*K
56 Isabel, Heather, Jeff 0.085 L*atm/mol*K
57 Isabel, Heather, Jeff 0.086 L*atm/mol*K
In [10]:
# The std dev of this group's R values heather["R values"].std()
0.0041735450471834575
In [ ]: