Skip to content

Commit b8dad33

Browse files
committed
added exercise
1 parent f8b03e0 commit b8dad33

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

notebooks/exercise.jmd

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Exercise
2+
3+
Download the file processed_data/03_data_trial_main.csv from the
4+
[mb1-analysis-public]((https://github.com/manybabies/mb1-analysis-public/) repository on github (or clone the repository).
5+
Read the file using Julia's CSV package and convert the table to a DataFrame.
6+
Use describe to summarize the data frame. Can you detect any problems with the data set?
7+
8+
Loading packages:
9+
```julia
10+
cd("Documents/DataScienceWorkshop")
11+
using DrWatson
12+
@quickactivate
13+
using Arrow, CSV, DataFrames, HTTP, Tables
14+
15+
Reading data:
16+
```julia
17+
f = CSV.File(
18+
HTTP.get("https://github.com/manybabies/mb1-analysis-public/raw/master/processed_data/03_data_trial_main.csv").body,
19+
missingstrings = ["NA"],
20+
truestrings = ["TRUE"],
21+
falsestrings = ["FALSE"],
22+
);
23+
```
24+
25+
```julia
26+
length(f)
27+
schem = Tables.schema(f)
28+
ct = Tables.columntable(f)
29+
typeof(ct)
30+
```
31+
32+
Convert to DataFrame and describe:
33+
```julia
34+
df = DataFrame(ct);
35+
describe(df)
36+
```

0 commit comments

Comments
 (0)