=LaTeX::Math("t_0")
This file contains hidden or 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
decimal | |
places degrees distance | |
------- ------- -------- | |
0 1 111 km | |
1 0.1 11.1 km | |
2 0.01 1.11 km | |
3 0.001 111 m | |
4 0.0001 11.1 m | |
5 0.00001 1.11 m | |
6 0.000001 11.1 cm |
This file contains hidden or 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
unique_venues = sites_with_foot_traffic.drop_duplicates(subset=['name']) | |
# initialize map | |
map = folium.Map(location = [30.3006387,-97.7587983], | |
zoom_start = 11, | |
tiles='Stamen Toner') | |
# add pins of candidate locations | |
for _, r in unique_venues.iterrows(): | |
geo_j = gpd.GeoSeries(r['geo']).to_json() |
This file contains hidden or 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
# examples: https://pandas.pydata.org/pandas-docs/stable/user_guide/style.html | |
SHOW_N = 15 | |
( | |
pd.concat([km_vs_census_county.head(SHOW_N), km_vs_census_county.tail(SHOW_N)]) | |
.style.bar(subset=['diff_pct'], align='zero', color=['#d65f5f', '#5fba7d']) | |
.bar(subset=['pop'], align='left', color=['lightblue']) | |
) |
This file contains hidden or 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 | |
"Rajkot City" as name, | |
ST_GeogFromText('Polygon((22.34784492579322 70.7388523794632, 22.355323924868447 70.8053762206165, 22.326248911520796 70.8656791529891, 22.31437981716447 70.85284874184599, 22.24910789523421 70.94889071900057, 22.228288250932245 70.94465075865024, 22.215764615136106 70.92166299169969, 22.229806743896408 70.87265587874343, 22.25464706420604 70.8512638822403, 22.255187022256013 70.83998446735355, 22.24942736237542 70.8347337052511, 22.25158726259193 70.8281216344554, 22.230706832103227 70.82170403633019, 22.22530621441818 70.80828542206835, 22.208743023287838 70.81042462144343, 22.19307820698311 70.80342360530682, 22.193618402156407 70.79681153451114, 22.230886849109833 70.7915607724087, 22.237187298322823 70.77114113787808, 22.234487140323587 70.75791699628672, 22.23592723106375 70.73380238514952, 22.246367446344223 70.7022978125348, 22.262026310267927 70.69393548770496, 22.277143551277188 70.69938072247787, 22.26490591066832 70.71416064543293, 22.269405167673817 70.716883 |
This file contains hidden or 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
from IPython.display import IFrame | |
from IPython.core.display import display | |
display(IFrame('https://www.capolicylab.org/calexodus-are-people-leaving-california/', '100%', '400px')) |
This file contains hidden or 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 | |
categories = ['accommodation','financial','tourism', | |
'shopping', 'food&drinks'] | |
fig = go.Figure() | |
fig.add_trace(go.Scatterpolar( | |
r=[1, 5, 2, 2, 3], | |
theta=categories, |
This file contains hidden or 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
bq load \ | |
--source_format=NEWLINE_DELIMITED_JSON \ | |
--json_extension=GEOJSON \ | |
--project_id=uc-project-id\ | |
--autodetect \ | |
dataset.new_table \ | |
Arkansas.geojson |
This file contains hidden or 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
DECLARE i INT64 DEFAULT 0; | |
DECLARE DATES ARRAY<DATE>; | |
DECLARE event_date DATE; | |
SET DATES = GENERATE_DATE_ARRAY(DATE(2019,1,1), DATE(2019, 12, 31), INTERVAL 1 DAY); | |
LOOP | |
SET i = i + 1; | |
IF i > ARRAY_LENGTH(DATES) THEN |
This file contains hidden or 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 jslibs.h3.ST_GEOGPOINTFROMH3("u2ce02j") | |
SELECT jslibs.h3.ST_H3_BOUNDARY(jslibs.h3.ST_H3(ST_GEOGPOINT(13.377534960188237, 49.747300576525554), 11)) | |
SELECT jslibs.h3.h3GetResolution("u2ce02j"); | |
# lat/lon to hexagon | |
SELECT jslibs.h3.ST_H3(ST_GEOGPOINT(statistics.coordinate.longitude, statistics.coordinate.latitude), 10) AS dwell_hex_id, | |
WITH polygon AS ( |