Fix cumulative co2 emissions

This commit is contained in:
heyarne 2021-02-27 09:13:02 +01:00
commit e7d682252e
2 changed files with 8 additions and 6 deletions

View file

@ -25,25 +25,27 @@ done
#+RESULTS: #+RESULTS:
*** Cumulative CO2 *** Cumulative CO2 emissions
Source: https://ourworldindata.org/grapher/cumulative-co-emissions Source: https://ourworldindata.org/grapher/cumulative-co-emissions
#+begin_src bash :results output replace #+begin_src bash :results output replace
csvs-to-sqlite \ csvs-to-sqlite \
--shape 'Entity:entity(text),Code:code(text),Year:year(integer),"Cumulative CO2 emissions":cumulative_co2_emissions(real)' \ --shape 'Entity:entity(text),Code:code(text),Year:year(integer),Cumulative CO2 emissions:cumulative_co2_emissions(real)' \
-c entity -c code -i year \ --extract-column entity,code \
--index year \
--replace-tables \
sources/cumulative_co2_emissions.csv dbs/climate.db sources/cumulative_co2_emissions.csv dbs/climate.db
#+end_src #+end_src
#+RESULTS: #+RESULTS:
: extract_columns=('entity', 'code') : extract_columns=('entity,code',)
: Loaded 0 dataframes : Loaded 1 dataframes
: Added 1 CSV file to dbs/climate.db : Added 1 CSV file to dbs/climate.db
** Pitalls ** Pitalls
*** My Queries are slow, what do I do? *** My queries are slow, what do I do?
Make sure SQlite uses the correct indices. You can debug this by writing Make sure SQlite uses the correct indices. You can debug this by writing

Binary file not shown.