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
# Get gh access token: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token | |
# How to use the GraphQL API on gh: https://docs.github.com/en/issues/planning-and-tracking-with-projects/automating-your-project/using-the-api-to-manage-projects#finding-information-about-items-in-a-project | |
import requests | |
import json | |
# Set config | |
url = 'https://api.github.com/graphql' | |
# token = ... |
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
import plotly.graph_objects as go | |
import plotly.express as px | |
import pandas as pd | |
from plotly.subplots import make_subplots | |
df = px.data.gapminder() | |
# Rewritten to show side by side | |
fig = make_subplots( | |
rows=1, cols=2, shared_yaxes=True, subplot_titles=('Scatter Plot', 'Map'), |
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
select id_grid_h3, hora, ST_ASTEXT(ANY_VALUE(geometria)) wkt, count(*) n_registros, ANY_VALUE(quantidade_pessoas) populacao | |
from `rj-smtr.br_rj_riodejaneiro_onibus_gps.registros_tratada` t1 | |
join `basedosdados.br_ipea_acesso_oportunidades.estatisticas_2019` t2 | |
on st_intersects(geometria, st_geogpoint(longitude, latitude)) | |
where id_municipio in ( | |
select id_municipio | |
from `basedosdados.br_bd_diretorios_brasil.municipio` | |
where nome = 'Rio de Janeiro') | |
group by id_grid_h3, hora |
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
# runs to unpack wheel to 3 subfolders: streamlit-0.70.0, streamlit-0.70.0.data, streamlit-0.70.0.dist_info | |
# (you can just delete or move this whl to other place now) | |
unzip streamlit-0.70.0-py2.py3-none-any.whl | |
# GO CRAZY: change whatever you need in the unpacked folder! ... | |
# make dir with folder name you want to pack again | |
mkdir streamlit-0.70.0-py2.py3-none-any | |
# move the 3 subfolders to the folder created |