Skip to content

Instantly share code, notes, and snippets.

@dcmoura
Last active March 30, 2022 08:18
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dcmoura/7a0d2dd2a230271a4628b481ec8b5ee8 to your computer and use it in GitHub Desktop.
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
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