October 2017
Intermediate to advanced
382 pages
11h 26m
English
First, we will import the libraries we need and connect them to our GIS instance, as follows:
import pandas as pd
from arcgis.gis import GIS
gis = GIS("https://www.masteringageadmin.com/portal",
"portaladmin", "password")
Next, we will use the ExcelFile method of pandas to load our Excel workbook into a pandas object. We will then call parse on the sheet with our data; Sheet1 in this instance:
xls_file = pd.ExcelFile(r"C:\data\station-data.xlsx")
df = xls_file.parse("Sheet1")
We can print out the DataFrame as follows by calling the df variable:
df

We will now call to_csv on our DataFrame object to ...