python beyond the basics …. ghislain prince jeff bigos
TRANSCRIPT
![Page 1: Python Beyond the Basics …. Ghislain Prince Jeff Bigos](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649f2f5503460f94c48fab/html5/thumbnails/1.jpg)
Python Beyond the Basics ….Ghislain Prince
Jeff Bigos
![Page 2: Python Beyond the Basics …. Ghislain Prince Jeff Bigos](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649f2f5503460f94c48fab/html5/thumbnails/2.jpg)
ComprehensionsComprehensions
CursorsCursors
ModulesModules
GeometryGeometry
![Page 3: Python Beyond the Basics …. Ghislain Prince Jeff Bigos](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649f2f5503460f94c48fab/html5/thumbnails/3.jpg)
Comprehensions
![Page 4: Python Beyond the Basics …. Ghislain Prince Jeff Bigos](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649f2f5503460f94c48fab/html5/thumbnails/4.jpg)
Comprehensions
• List Comprehensions- Loop and filter items from an existing list
- List is returned
![Page 5: Python Beyond the Basics …. Ghislain Prince Jeff Bigos](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649f2f5503460f94c48fab/html5/thumbnails/5.jpg)
Comprehensions
• List Comprehensions- Loop and filter items from an existing list
- List is returned
![Page 6: Python Beyond the Basics …. Ghislain Prince Jeff Bigos](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649f2f5503460f94c48fab/html5/thumbnails/6.jpg)
Comprehensions
• List Comprehensions- Loop and filter items from an existing list
- List is returned
![Page 7: Python Beyond the Basics …. Ghislain Prince Jeff Bigos](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649f2f5503460f94c48fab/html5/thumbnails/7.jpg)
Comprehensions
• List Comprehensions- Loop and filter items from an existing list
- List is returned
![Page 8: Python Beyond the Basics …. Ghislain Prince Jeff Bigos](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649f2f5503460f94c48fab/html5/thumbnails/8.jpg)
Comprehensions
• Dictionary Comprehensions- Loop and filter items from an existing Dictionary
- Dictionary is returned
![Page 9: Python Beyond the Basics …. Ghislain Prince Jeff Bigos](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649f2f5503460f94c48fab/html5/thumbnails/9.jpg)
Comprehensions
• Dictionary Comprehensions- Loop and filter items from an existing Dictionary
- Dictionary is returned
![Page 10: Python Beyond the Basics …. Ghislain Prince Jeff Bigos](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649f2f5503460f94c48fab/html5/thumbnails/10.jpg)
Comprehensions
• Dictionary Comprehensions- Loop and filter items from an existing Dictionary
- Dictionary is returned
![Page 11: Python Beyond the Basics …. Ghislain Prince Jeff Bigos](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649f2f5503460f94c48fab/html5/thumbnails/11.jpg)
Cursors
![Page 12: Python Beyond the Basics …. Ghislain Prince Jeff Bigos](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649f2f5503460f94c48fab/html5/thumbnails/12.jpg)
Cursors
• Two varieties- Arcpy.da cursors (10.1 onwards)
- ‘Classic’ cursors
Type Function
SearchCursor Read-only
UpdateCursor Update or delete rows
InsertCursor Insert rows
![Page 13: Python Beyond the Basics …. Ghislain Prince Jeff Bigos](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649f2f5503460f94c48fab/html5/thumbnails/13.jpg)
Understanding Data access Cursors
• Fields parameter - Index position in fields parameter defines value access
- Provide needed fields
![Page 14: Python Beyond the Basics …. Ghislain Prince Jeff Bigos](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649f2f5503460f94c48fab/html5/thumbnails/14.jpg)
Understanding Data access Cursors
• Fields parameter - Index position in fields parameter defines value access
- Provide needed fields
![Page 15: Python Beyond the Basics …. Ghislain Prince Jeff Bigos](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649f2f5503460f94c48fab/html5/thumbnails/15.jpg)
Understanding Data access Cursors
• Where Clause- Filters the records returned
• Spatial Reference- Project data on the fly
![Page 16: Python Beyond the Basics …. Ghislain Prince Jeff Bigos](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649f2f5503460f94c48fab/html5/thumbnails/16.jpg)
Geometry
![Page 17: Python Beyond the Basics …. Ghislain Prince Jeff Bigos](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649f2f5503460f94c48fab/html5/thumbnails/17.jpg)
![Page 18: Python Beyond the Basics …. Ghislain Prince Jeff Bigos](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649f2f5503460f94c48fab/html5/thumbnails/18.jpg)
Creating Geometry
![Page 19: Python Beyond the Basics …. Ghislain Prince Jeff Bigos](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649f2f5503460f94c48fab/html5/thumbnails/19.jpg)
• List of coordinates- *coords
Creating Geometry
![Page 20: Python Beyond the Basics …. Ghislain Prince Jeff Bigos](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649f2f5503460f94c48fab/html5/thumbnails/20.jpg)
• Relational:- Is a point within a polygon
- Return Boolean Values
Geometry Operators
![Page 21: Python Beyond the Basics …. Ghislain Prince Jeff Bigos](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649f2f5503460f94c48fab/html5/thumbnails/21.jpg)
• Contains:
Geometry Operators
• Crosses: • Touches:
• Additional Methods in the documentation
![Page 22: Python Beyond the Basics …. Ghislain Prince Jeff Bigos](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649f2f5503460f94c48fab/html5/thumbnails/22.jpg)
Modules
![Page 23: Python Beyond the Basics …. Ghislain Prince Jeff Bigos](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649f2f5503460f94c48fab/html5/thumbnails/23.jpg)
Modules: Included with python
- urllib: functions and classes for using internet resources- Urlencodings, POST, GET
- json: work with json data- Encoding, decoding
- zipfile: create and extract from zipfiles
- Resources:- Python help: Global Module Index
- Python module of the week
![Page 24: Python Beyond the Basics …. Ghislain Prince Jeff Bigos](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649f2f5503460f94c48fab/html5/thumbnails/24.jpg)
Modules: Included with ArcGIS
- numpy: n- dimensional array- Spatial Analyst, arcpy.da conversion functions
- matplotlib: Graphing and Charting- Spatial Statistics visual outputs
- xlrd / xlwt: read and write excel files- Used in the excel toolset
- Resources:- Python help: Global Module Index
- Python module of the week
![Page 25: Python Beyond the Basics …. Ghislain Prince Jeff Bigos](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649f2f5503460f94c48fab/html5/thumbnails/25.jpg)