Skip to content

Instantly share code, notes, and snippets.

@apfister
Created April 3, 2018 16:39
Show Gist options
  • Save apfister/c72e59fb7d8db07dc3e489fd13ca8933 to your computer and use it in GitHub Desktop.
Save apfister/c72e59fb7d8db07dc3e489fd13ca8933 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Latitude</th>\n",
" <th>Longitude</th>\n",
" <th>DateTime(GMT)</th>\n",
" <th>Fcst Hour</th>\n",
" <th>Day of Week</th>\n",
" <th>Temp</th>\n",
" <th>DewPt</th>\n",
" <th>Precipitation Amount</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>36</td>\n",
" <td>-115</td>\n",
" <td>3/26/18 19:00</td>\n",
" <td>1</td>\n",
" <td>Monday</td>\n",
" <td>55</td>\n",
" <td>12</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>36</td>\n",
" <td>-115</td>\n",
" <td>3/26/18 20:00</td>\n",
" <td>2</td>\n",
" <td>Monday</td>\n",
" <td>57</td>\n",
" <td>12</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>36</td>\n",
" <td>-115</td>\n",
" <td>3/26/18 21:00</td>\n",
" <td>3</td>\n",
" <td>Monday</td>\n",
" <td>58</td>\n",
" <td>10</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>36</td>\n",
" <td>-115</td>\n",
" <td>3/26/18 22:00</td>\n",
" <td>4</td>\n",
" <td>Monday</td>\n",
" <td>59</td>\n",
" <td>9</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>36</td>\n",
" <td>-115</td>\n",
" <td>3/26/18 23:00</td>\n",
" <td>5</td>\n",
" <td>Monday</td>\n",
" <td>61</td>\n",
" <td>8</td>\n",
" <td>0</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Latitude Longitude DateTime(GMT) Fcst Hour Day of Week Temp DewPt \\\n",
"0 36 -115 3/26/18 19:00 1 Monday 55 12 \n",
"1 36 -115 3/26/18 20:00 2 Monday 57 12 \n",
"2 36 -115 3/26/18 21:00 3 Monday 58 10 \n",
"3 36 -115 3/26/18 22:00 4 Monday 59 9 \n",
"4 36 -115 3/26/18 23:00 5 Monday 61 8 \n",
"\n",
" Precipitation Amount \n",
"0 0 \n",
"1 0 \n",
"2 0 \n",
"3 0 \n",
"4 0 "
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from arcgis.gis import *\n",
"import pandas as pd\n",
"\n",
"gis = GIS()\n",
"m = gis.map('Henderson, NV')\n",
"\n",
"in_csv = 'test-files/FODoutput_csv.csv'\n",
"df = pd.read_csv(in_csv)\n",
"df.head()"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "e81e67ffdb3f4c10872e3292a6540a64"
}
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"pts = gis.content.import_data(df)\n",
"m.add_layer(pts)\n",
"m"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.1"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment