San Francisco: 06075
Chicago (Cook county): 17031
Los Angeles County: 06037
Seattle (King County): 53033
New York:
New York County (Manhattan): 36061
Kings County (Brooklyn): 36047
Bronx County (The Bronx): 36005
| colors = ['aliceblue', 'antiquewhite', 'aqua', 'aquamarine', 'azure', | |
| 'beige', 'bisque', 'black', 'blanchedalmond', 'blue', | |
| 'blueviolet', 'brown', 'burlywood', 'cadetblue', | |
| 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', | |
| 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', | |
| 'darkgoldenrod', 'darkgray', 'darkgrey', 'darkgreen', | |
| 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', | |
| 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', | |
| 'darkslateblue', 'darkslategray', 'darkslategrey', | |
| 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', |
| df.query('a in ["a", "b", "c"]') | |
| id_list = ["a", "b", "c"] | |
| df.query('a in @id_list') |
| SUBSTR(FORMAT("00%d", state_fips ), -2) as state_fips, | |
| SUBSTR(FORMAT("00000%d", fips ), -5) as fips, |
| ARRAY_TO_STRING(homeContext.fipscode, ',') |
| from cartoframes.viz import Map, Layer, basemaps | |
| from cartoframes.viz import Layer, color_continuous_style, color_bins_style, basic_style, color_category_legend | |
| _df = average_duration.copy() | |
| metric = 'avg_duration_day' | |
| origin_county = selected_area_geom.iloc[0]['county_name'] | |
| origin_state = selected_area_geom.iloc[0]['state_name'] |
| pd.set_option('mode.chained_assignment', None) |
| ST_Y(ST_CENTROID(geog)) AS tract_lat, | |
| ST_X(ST_CENTROID(geog)) AS tract_lon, |
| slack_message = "Home & Work for bundleId {} is ready for shipping!".format("{{ ti.xcom_pull(task_ids='get_bundle_id') }}") | |
| notify_slack = SimpleHttpOperator( | |
| task_id="notify_slack", | |
| endpoint=slack_webhook_url, | |
| data=json.dumps( | |
| {"attachments": [{"fallback": slack_message, "text": slack_message, "color": "good"}]}), | |
| headers={"Content-Type": "application/json"}, | |
| depends_on_past=False, | |
| response_check=lambda response: True if response.status_code == 200 else False, | |
| http_conn_id="http_slack_hook" |
San Francisco: 06075
Chicago (Cook county): 17031
Los Angeles County: 06037
Seattle (King County): 53033
New York:
New York County (Manhattan): 36061
Kings County (Brooklyn): 36047
Bronx County (The Bronx): 36005
| !pip install plotly==4.8 | |
| # Quick way to install hind font | |
| !npm install -g google-font-installer | |
| !gfi install hind -v 300 | |
| import plotly.graph_objs as go | |
| import plotly.io as pio | |
| pd.options.plotting.backend = "plotly" |