Created
February 1, 2025 20:57
-
-
Save mattwigway/a4c285018272d8ff067cba27098198c5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```{julia} | |
using CSV, DataFrames, Plots, Downloads, ProgressMeter | |
``` | |
Download data | |
```{julia} | |
if !isfile("bay_area_freeways.csv.gz") | |
progress = nothing | |
Downloads.download("https://files.indicatrix.org/bay_area_freeways.csv.gz", "bay_area_freeways.csv.gz", | |
progress=(total, sofar) -> begin | |
if total > 0 && isnothing(progress) | |
progress = Progress(total) | |
elseif total > 0 | |
update!(progress, sofar) | |
end | |
end) | |
finish!(progress) | |
else | |
println("Data already downloaded.") | |
end | |
``` | |
## Read data | |
```{julia} | |
sensors = CSV.read("bay_area_freeways.csv.gz", DataFrame) | |
``` | |
Make a large plot | |
```{julia} | |
# this will cause VSCode to hang | |
#scatter(sensors.avg_occ, sensors.avg_speed_mph, fmt=:png) | |
# This is small enough VSCode will not hang, but you can inspect to see that is rendered as SVG | |
scatter(sensors.avg_occ[1:1000], sensors.avg_speed_mph[1:1000], fmt=:png) | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment