Skip to content

Commit 3c99542

Browse files
Update case study notebooks + regenerate
1 parent a1cad86 commit 3c99542

File tree

65 files changed

+1589
-3464
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+1589
-3464
lines changed

_solved/case1_bike_count.ipynb

Lines changed: 103 additions & 521 deletions
Large diffs are not rendered by default.

_solved/case2_observations_analysis.ipynb

Lines changed: 327 additions & 266 deletions
Large diffs are not rendered by default.

_solved/case2_observations_processing.ipynb

Lines changed: 295 additions & 731 deletions
Large diffs are not rendered by default.

_solved/case3_bacterial_resistance_lab_experiment.ipynb

Lines changed: 126 additions & 233 deletions
Large diffs are not rendered by default.
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
def process_bike_count_data(df):
22
"""Process the provided dataframe: parse datetimes and rename columns.
3-
3+
44
Parameters
55
----------
66
df : pandas.DataFrame
7-
DataFrame as read from the raw `fietstellingen`,
8-
containing the `datum`, `tijd`, `ri Centrum`
7+
DataFrame as read from the raw `fietstellingen`,
8+
containing the `datum`, `tijd`, `ri Centrum`
99
and `ri Mariakerke` columns.
10-
10+
1111
Returns
1212
-------
1313
df2 : pandas.DataFrame
14-
DataFrame with the datetime info as index and the
15-
`direction_centre` and `direction_mariakerke` columns
14+
DataFrame with the datetime info as index and the
15+
`direction_centre` and `direction_mariakerke` columns
1616
with the counts.
1717
"""
18-
df.index = pd.to_datetime(df['datum'] + ' ' + df['tijd'],
18+
df.index = pd.to_datetime(df['datum'] + ' ' + df['tijd'],
1919
format="%d/%m/%Y %H:%M")
2020
df2 = df.drop(columns=['datum', 'tijd'])
21-
df2 = df2.rename(columns={'ri Centrum': 'direction_centre',
21+
df2 = df2.rename(columns={'ri Centrum': 'direction_centre',
2222
'ri Mariakerke':'direction_mariakerke'})
2323
return df2
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
df2 = df2.rename(columns={'ri Centrum': 'direction_centre',
1+
df2 = df2.rename(columns={'ri Centrum': 'direction_centre',
22
'ri Mariakerke':'direction_mariakerke'})
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
survey_data_processed = pd.read_csv("data/survey_data_completed.csv",
1+
survey_data_processed = pd.read_csv("data/survey_data_completed.csv",
22
parse_dates=['eventDate'], index_col="occurrenceID")
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
survey_data = survey_data_unique.dropna(subset=['species']).copy()
2-
survey_data['name'] = survey_data['genus'] + ' ' + survey_data['species']
1+
mask = survey_data_unique['species'].isna() & survey_data_unique['sex'].notna()
2+
not_identified = survey_data_unique[mask]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
survey_data.groupby("name").size().nlargest(8)
1+
non_rodent_species = survey_data[survey_data['taxa'].isin(['Rabbit', 'Bird', 'Reptile'])]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
survey_data['name'].value_counts()[:8]
1+
r_species = survey_data[survey_data['name'].str.lower().str.startswith('r')]

0 commit comments

Comments
 (0)