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
""" | |
This file is a standlone library to convert polling data from one geography to another. | |
It has minimal dependencies beyond pandas. | |
Ideally it uses parquet and pyarrow - but if this is an obstacle, | |
adjust the parquet references to csv. | |
Note, when converting to LAD23, this is the lower level geography. | |
Additional conversion for higher level is in convert_specific_polling.py | |
in the climate_mrp_polling package. |
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
wsl --shutdown | |
diskpart | |
select vdisk file="C:\Users\USER\AppData\Local\Docker\wsl\data\ext4.vhdx" | |
attach vdisk readonly | |
compact vdisk | |
detach vdisk | |
exit |
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
# Wikidata/R script to find the midpoint of all current star trek tv/films | |
library(WikidataQueryServiceR) | |
query <- ' | |
SELECT DISTINCT ?item ?itemLabel ?duration ?startrekLabel | |
WHERE | |
{ | |
#star trek films | |
{?item wdt:P31 wd:Q61283808.} |
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
# Roundtrip json bods to xlsx | |
import os | |
import openpyxl | |
import json | |
from tempfile import TemporaryDirectory | |
from flattentool import flatten, unflatten | |
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
[{"children": [], "child_of": null, "link": "https://docs.google.com/document/d/1as8y1rV3EEnyHDTlKsWZ988NnUs5QvUgT-RruUrCwV0/edit#heading=h.8n1yv86y9wvz", "name": "Introduction", "id": 1}, {"children": [{"children": [], "child_of": 2, "link": "https://docs.google.com/document/d/1as8y1rV3EEnyHDTlKsWZ988NnUs5QvUgT-RruUrCwV0/edit#heading=h.2zqzc2994t4y", "name": "Design", "id": 3}, {"children": [], "child_of": 2, "link": "https://docs.google.com/document/d/1as8y1rV3EEnyHDTlKsWZ988NnUs5QvUgT-RruUrCwV0/edit#heading=h.3w2umh6zwbbd", "name": "Discoverability", "id": 4}, {"children": [], "child_of": 2, "link": "https://docs.google.com/document/d/1as8y1rV3EEnyHDTlKsWZ988NnUs5QvUgT-RruUrCwV0/edit#heading=h.xxzaducm929a", "name": "Accessibility", "id": 5}, {"children": [], "child_of": 2, "link": "https://docs.google.com/document/d/1as8y1rV3EEnyHDTlKsWZ988NnUs5QvUgT-RruUrCwV0/edit#heading=h.s7hmntikgtgr", "name": "Plain language", "id": 6}, {"children": [], "child_of": 2, "link": "https://docs.google.com/document/d/1as8y |
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
[{"children": [], "child_of": null, "link": "https://docs.google.com/document/d/17sMqrBrQO89pkSly8vg2CNOvm26bsqgPrZ-S-q4EsvQ/edit#heading=h.apm3u78ms6oq", "name": "Introduction", "id": 1}, {"children": [], "child_of": null, "link": "https://docs.google.com/document/d/17sMqrBrQO89pkSly8vg2CNOvm26bsqgPrZ-S-q4EsvQ/edit#heading=h.hl4hiday6wcc", "name": "Potential uses of digital tools", "id": 2}, {"children": [{"children": [], "child_of": 3, "link": "https://docs.google.com/document/d/17sMqrBrQO89pkSly8vg2CNOvm26bsqgPrZ-S-q4EsvQ/edit#heading=h.wnh22yd3dipg", "name": "Question forming", "id": 4}, {"children": [], "child_of": 3, "link": "https://docs.google.com/document/d/17sMqrBrQO89pkSly8vg2CNOvm26bsqgPrZ-S-q4EsvQ/edit#heading=h.lfshf3fygn0a", "name": "Public submissions", "id": 5}, {"children": [], "child_of": 3, "link": "https://docs.google.com/document/d/17sMqrBrQO89pkSly8vg2CNOvm26bsqgPrZ-S-q4EsvQ/edit#heading=h.v3wu5gbewhp4", "name": "Finding experts and stakeholders", "id": 6}], "child_of": null, "link": "h |