Last active
March 30, 2022 08:18
-
-
Save dcmoura/7a0d2dd2a230271a4628b481ec8b5ee8 to your computer and use it in GitHub Desktop.
Plot of the global temperature trend using the command-line with SPyQL and rush
This file contains 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
http https://data.giss.nasa.gov/gistemp/tabledata_v4/GLB.Ts+dSST.csv | sed 1d | | |
spyql " | |
SELECT Year, cols[1:13] AS temps | |
FROM csv | |
TO json" | | |
spyql " | |
SELECT json->Year + ((row_number-1)%12)/12 AS year, json->temps AS temp | |
FROM json | |
EXPLODE json->temps | |
WHERE json->temps is not Null | |
TO csv" | | |
rush plot --x year --y temp --xlab 'Year' --ylab 'Temperature anomaly w.r.t. 1951-80 (ºC)' --geom smooth --title 'Global surface temperature trend (land and ocean)' -o global_temperature_trend.png |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment