Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
ArcPy and ArcGIS

You're reading from   ArcPy and ArcGIS Automating ArcGIS for Desktop and ArcGIS Online with Python

Arrow left icon
Product type Paperback
Published in Jun 2017
Publisher Packt
ISBN-13 9781787282513
Length 272 pages
Edition 2nd Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Silas Toms Silas Toms
Author Profile Icon Silas Toms
Silas Toms
Dara OBeirne Dara OBeirne
Author Profile Icon Dara OBeirne
Dara OBeirne
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Introduction to Python for ArcGIS 2. Creating the First Python Script FREE CHAPTER 3. ArcPy Cursors - Search, Insert, and Update 4. ArcPy Geometry Objects and Cursors 5. Creating a Script Tool 6. The arcpy.mapping Module 7. Advanced Analysis Topics 8. Introduction to ArcGIS Online 9. ArcPy and ArcGIS Online 10. ArcREST Python Package 11. ArcPy and ArcGIS Pro 12. ArcGIS API for Python

Importing a CSV with pandas

As a GIS professional, you encounter many data types that you have to manage. Much of the data you will manage is commonly in a comma-separated value (CSV) format. Later, I will show you how to add a CSV as an item to your ArcGIS Online organization. In addition, if that CSV has a Lat/Long or X/Y, you can also add it as a spatial feature layer to you GIS.

To work with CSVs, we will be using an open source Python library called pandas. First, we import pandas and call it pd and then we build a data frame using the read_csv function from pandas. A data frame is a structured way of viewing data; you can think of it as a spreadsheet or an SQL table. In the next figure, you can see what a data frame looks like when we build it from our SFPF_2016.csv. For the purposes of this exercise, I have reduced SFPD_2016.csv from its original size of 150,000 records...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime