SlideShare a Scribd company logo
Python in 10.1
Thom Mackey
Contents


• arcpy   Enhancements

• Add-ins

• Python   Toolboxes
FeatureClassToNumPyArray
import arcpy
import numpy
input = "C:/Data/ABSData.gdb/VIC_CCDs"
arr = arcpy.da.FeatureClassToNumPyArray(input,('CCD', 'pop_m', 'pop_f'))
# Sum the total population for males & females #
print(arr['pop_m'].sum())
print(arr['pop_f'].sum())
# Sum the female population for a particular CCD #
print(arr[arr['CCD'] == "2010101"]['pop_f'].sum())
FeatureClassToNumPyArray

import arcpy
import numpy
input = "C:/Data/ABSData.gdb/VIC_CCDs"
field1 = "INCOME"
field2 = "EDUCATION"
arr = arcpy.da.FeatureClassToNumPyArray(input, (field1, field2))
# Print correlation coefficients for the two fields
print(numpy.corrcoef((arr[field1],arr[field2])))
Improved Cursors



# Turn the contents of a GDB table into a Python list of lists
# Simple syntax & little code
with arcpy.da.SearchCursor(zonalstats_results_table,
                           ["MINORITY","MAJORITY","MEAN"]) as tblcur:
       results = [r for r in tblcur]
Improved Cursors
import arcpy
arcpy.env.workspace = "c:/data/output.gdb"
fc = "c:/data/base.gdb/roads"
fields = ("ROAD_TYPE", "BUFFER_DISTANCE")
with arcpy.da.UpdateCursor(fc, fields) as cursor:
# Update the field used in Buffer so the distance is based on road
# type. Road type is either 1, 2, 3 or 4. Distance is in meters.
       for row in cursor:
               row[1] = row[0] * 100
               cursor.updateRow(row)
arcpy.mapping: update/apply symbology
import arcpy
mxd = arcpy.mapping.MapDocument(r"C:ProjectProject.mxd")
df = arcpy.mapping.ListDataFrames(mxd, "Census")[0]
lyr = arcpy.mapping.ListLayers(mxd, "StatePopulation", df)[0]
lyrFile = arcpy.mapping.Layer(r"C:ProjectLYRsPopulation.lyr")
arcpy.mapping.UpdateLayer(df, lyr, lyrFile, True)
if lyr.symbologyType == "GRADUATED_COLORS":
         lyr.symbology.valueField = "POP2000"
         lyr.symbology.classBreakValues = [250000, 999999, 4999999, 9999999, 35000000]
         lyr.symbology.classBreakLabels = ["250,000 to 999,999", "1,000,000 to 4,999,999",
                                              "5,000,000 to 9,999,999",
                                              "10,000,000 to 35,000,000"]
arcpy.mapping.ExportToPDF(mxd, r"C:ProjectOutputStatePopulation.pdf")
del mxd, lyrFile
Add-Ins
Python Toolboxes

More Related Content

What's hot

Gopher conbr golang e data science - oficial
Gopher conbr   golang e data science - oficialGopher conbr   golang e data science - oficial
Gopher conbr golang e data science - oficial
Rodrigo Pinheiro
 
ELECTRICAL POWER SYSTEMS ECONOMICS
ELECTRICAL POWER SYSTEMS ECONOMICSELECTRICAL POWER SYSTEMS ECONOMICS
ELECTRICAL POWER SYSTEMS ECONOMICS
MohammedMedani4
 
Thesis PPT
Thesis PPTThesis PPT
Thesis PPT
Drew Ferkin
 
program on Function overloading in java
program on  Function overloading in javaprogram on  Function overloading in java
program on Function overloading in java
One97 Communications Limited
 
Visualization team presentation
Visualization team presentation Visualization team presentation
Visualization team presentation
madhobilota
 
Coq for ML users
Coq for ML usersCoq for ML users
Coq for ML users
tmiya
 
peRm R group. Review of packages for r for market data downloading and analysis
peRm R group. Review of packages for r for market data downloading and analysispeRm R group. Review of packages for r for market data downloading and analysis
peRm R group. Review of packages for r for market data downloading and analysis
Vyacheslav Arbuzov
 
Python Set.pptx
Python Set.pptxPython Set.pptx
Python Set.pptx
RoopKumarDhanavath
 
Py lecture5 python plots
Py lecture5 python plotsPy lecture5 python plots
Py lecture5 python plots
Yoshiki Satotani
 
Om (Cont.)
Om (Cont.)Om (Cont.)
Om (Cont.)
Taku Fukushima
 
2 18-2018-all teams total runs
2 18-2018-all teams total runs2 18-2018-all teams total runs
2 18-2018-all teams total runs
Alexander Bitar
 
Introducing the Microsoft Virtual Earth Silverlight Map Control CTP
Introducing the Microsoft Virtual Earth Silverlight Map Control CTPIntroducing the Microsoft Virtual Earth Silverlight Map Control CTP
Introducing the Microsoft Virtual Earth Silverlight Map Control CTP
goodfriday
 
test
testtest
Lecture 1 mte 407
Lecture 1 mte 407Lecture 1 mte 407
Lecture 1 mte 407
rumanatasnim415
 
Lecture 1 mte 407
Lecture 1 mte 407Lecture 1 mte 407
Lecture 1 mte 407
rumanatasnim415
 
La R Users Group Survey Of R Graphics
La R Users Group Survey Of R GraphicsLa R Users Group Survey Of R Graphics
La R Users Group Survey Of R Graphics
guest43ed8709
 
Python programing
Python programingPython programing
Python programing
BHAVYA DOSHI
 
BIometrics- plotting DET and EER curve using Matlab
BIometrics- plotting DET and EER curve using MatlabBIometrics- plotting DET and EER curve using Matlab
BIometrics- plotting DET and EER curve using Matlab
Shiv Koppad
 
Compiling fµn language
Compiling fµn languageCompiling fµn language
Compiling fµn language
Didier Plaindoux
 

What's hot (19)

Gopher conbr golang e data science - oficial
Gopher conbr   golang e data science - oficialGopher conbr   golang e data science - oficial
Gopher conbr golang e data science - oficial
 
ELECTRICAL POWER SYSTEMS ECONOMICS
ELECTRICAL POWER SYSTEMS ECONOMICSELECTRICAL POWER SYSTEMS ECONOMICS
ELECTRICAL POWER SYSTEMS ECONOMICS
 
Thesis PPT
Thesis PPTThesis PPT
Thesis PPT
 
program on Function overloading in java
program on  Function overloading in javaprogram on  Function overloading in java
program on Function overloading in java
 
Visualization team presentation
Visualization team presentation Visualization team presentation
Visualization team presentation
 
Coq for ML users
Coq for ML usersCoq for ML users
Coq for ML users
 
peRm R group. Review of packages for r for market data downloading and analysis
peRm R group. Review of packages for r for market data downloading and analysispeRm R group. Review of packages for r for market data downloading and analysis
peRm R group. Review of packages for r for market data downloading and analysis
 
Python Set.pptx
Python Set.pptxPython Set.pptx
Python Set.pptx
 
Py lecture5 python plots
Py lecture5 python plotsPy lecture5 python plots
Py lecture5 python plots
 
Om (Cont.)
Om (Cont.)Om (Cont.)
Om (Cont.)
 
2 18-2018-all teams total runs
2 18-2018-all teams total runs2 18-2018-all teams total runs
2 18-2018-all teams total runs
 
Introducing the Microsoft Virtual Earth Silverlight Map Control CTP
Introducing the Microsoft Virtual Earth Silverlight Map Control CTPIntroducing the Microsoft Virtual Earth Silverlight Map Control CTP
Introducing the Microsoft Virtual Earth Silverlight Map Control CTP
 
test
testtest
test
 
Lecture 1 mte 407
Lecture 1 mte 407Lecture 1 mte 407
Lecture 1 mte 407
 
Lecture 1 mte 407
Lecture 1 mte 407Lecture 1 mte 407
Lecture 1 mte 407
 
La R Users Group Survey Of R Graphics
La R Users Group Survey Of R GraphicsLa R Users Group Survey Of R Graphics
La R Users Group Survey Of R Graphics
 
Python programing
Python programingPython programing
Python programing
 
BIometrics- plotting DET and EER curve using Matlab
BIometrics- plotting DET and EER curve using MatlabBIometrics- plotting DET and EER curve using Matlab
BIometrics- plotting DET and EER curve using Matlab
 
Compiling fµn language
Compiling fµn languageCompiling fµn language
Compiling fµn language
 

Viewers also liked

[기초수학 박민근] 3.5 객체 계층도와 장면 그래프
[기초수학 박민근] 3.5 객체 계층도와 장면 그래프[기초수학 박민근] 3.5 객체 계층도와 장면 그래프
[기초수학 박민근] 3.5 객체 계층도와 장면 그래프MinGeun Park
 
[C++ lab] 5. sud 프로젝트 구현
[C++ lab] 5. sud 프로젝트 구현[C++ lab] 5. sud 프로젝트 구현
[C++ lab] 5. sud 프로젝트 구현
MinGeun Park
 
[C++ lab] 4. sud 프로젝트 시작
[C++ lab] 4. sud 프로젝트 시작[C++ lab] 4. sud 프로젝트 시작
[C++ lab] 4. sud 프로젝트 시작MinGeun Park
 
[C++ lab] 7. sud 프로젝트 구현(2)
[C++ lab] 7. sud 프로젝트 구현(2)[C++ lab] 7. sud 프로젝트 구현(2)
[C++ lab] 7. sud 프로젝트 구현(2)MinGeun Park
 
[C++ lab] 3. c++ 프로그래밍
[C++ lab] 3. c++ 프로그래밍[C++ lab] 3. c++ 프로그래밍
[C++ lab] 3. c++ 프로그래밍MinGeun Park
 
[페차쿠차] 신입 게임 개발자 상식사전
[페차쿠차] 신입 게임 개발자 상식사전[페차쿠차] 신입 게임 개발자 상식사전
[페차쿠차] 신입 게임 개발자 상식사전MinGeun Park
 
[C++ lab] 6. value,pointer,reference
[C++ lab] 6. value,pointer,reference[C++ lab] 6. value,pointer,reference
[C++ lab] 6. value,pointer,referenceMinGeun Park
 
[C++ lab] 1. 수업 내용 및 진행 방법
[C++ lab] 1. 수업 내용 및 진행 방법[C++ lab] 1. 수업 내용 및 진행 방법
[C++ lab] 1. 수업 내용 및 진행 방법MinGeun Park
 
[C++ lab] 8. sud 프로젝트 구현(3)
[C++ lab] 8. sud 프로젝트 구현(3)[C++ lab] 8. sud 프로젝트 구현(3)
[C++ lab] 8. sud 프로젝트 구현(3)MinGeun Park
 
[C++ lab] 9. 디버깅 테크닉
[C++ lab] 9. 디버깅 테크닉[C++ lab] 9. 디버깅 테크닉
[C++ lab] 9. 디버깅 테크닉MinGeun Park
 
[C++ lab] 2. hello world
[C++ lab] 2. hello world[C++ lab] 2. hello world
[C++ lab] 2. hello worldMinGeun Park
 
C++ 미정의 행동(undefined behavior)
C++ 미정의 행동(undefined behavior)C++ 미정의 행동(undefined behavior)
C++ 미정의 행동(undefined behavior)
은아 정
 
[C++ lab] 10. 메모리 누수 체크
[C++ lab] 10. 메모리 누수 체크[C++ lab] 10. 메모리 누수 체크
[C++ lab] 10. 메모리 누수 체크MinGeun Park
 
[Pl in c++] 6. battle ship 3
[Pl in c++] 6. battle ship 3[Pl in c++] 6. battle ship 3
[Pl in c++] 6. battle ship 3MinGeun Park
 
[C++adv] STL 사용법과 주의 사항
[C++adv] STL 사용법과 주의 사항[C++adv] STL 사용법과 주의 사항
[C++adv] STL 사용법과 주의 사항MinGeun Park
 
[1116 박민근] c++11에 추가된 새로운 기능들
[1116 박민근] c++11에 추가된 새로운 기능들[1116 박민근] c++11에 추가된 새로운 기능들
[1116 박민근] c++11에 추가된 새로운 기능들MinGeun Park
 
Modern C++ 프로그래머를 위한 CPP11/14 핵심
Modern C++ 프로그래머를 위한 CPP11/14 핵심Modern C++ 프로그래머를 위한 CPP11/14 핵심
Modern C++ 프로그래머를 위한 CPP11/14 핵심흥배 최
 
동국대 앱창작터 1일차:Cocos2d-X 소개, 환경설정, 주요개념
동국대 앱창작터 1일차:Cocos2d-X 소개, 환경설정, 주요개념동국대 앱창작터 1일차:Cocos2d-X 소개, 환경설정, 주요개념
동국대 앱창작터 1일차:Cocos2d-X 소개, 환경설정, 주요개념
Changhwan Yi
 
유니티의 툰셰이딩을 사용한 3D 애니메이션 표현
유니티의 툰셰이딩을 사용한 3D 애니메이션 표현유니티의 툰셰이딩을 사용한 3D 애니메이션 표현
유니티의 툰셰이딩을 사용한 3D 애니메이션 표현
MinGeun Park
 

Viewers also liked (19)

[기초수학 박민근] 3.5 객체 계층도와 장면 그래프
[기초수학 박민근] 3.5 객체 계층도와 장면 그래프[기초수학 박민근] 3.5 객체 계층도와 장면 그래프
[기초수학 박민근] 3.5 객체 계층도와 장면 그래프
 
[C++ lab] 5. sud 프로젝트 구현
[C++ lab] 5. sud 프로젝트 구현[C++ lab] 5. sud 프로젝트 구현
[C++ lab] 5. sud 프로젝트 구현
 
[C++ lab] 4. sud 프로젝트 시작
[C++ lab] 4. sud 프로젝트 시작[C++ lab] 4. sud 프로젝트 시작
[C++ lab] 4. sud 프로젝트 시작
 
[C++ lab] 7. sud 프로젝트 구현(2)
[C++ lab] 7. sud 프로젝트 구현(2)[C++ lab] 7. sud 프로젝트 구현(2)
[C++ lab] 7. sud 프로젝트 구현(2)
 
[C++ lab] 3. c++ 프로그래밍
[C++ lab] 3. c++ 프로그래밍[C++ lab] 3. c++ 프로그래밍
[C++ lab] 3. c++ 프로그래밍
 
[페차쿠차] 신입 게임 개발자 상식사전
[페차쿠차] 신입 게임 개발자 상식사전[페차쿠차] 신입 게임 개발자 상식사전
[페차쿠차] 신입 게임 개발자 상식사전
 
[C++ lab] 6. value,pointer,reference
[C++ lab] 6. value,pointer,reference[C++ lab] 6. value,pointer,reference
[C++ lab] 6. value,pointer,reference
 
[C++ lab] 1. 수업 내용 및 진행 방법
[C++ lab] 1. 수업 내용 및 진행 방법[C++ lab] 1. 수업 내용 및 진행 방법
[C++ lab] 1. 수업 내용 및 진행 방법
 
[C++ lab] 8. sud 프로젝트 구현(3)
[C++ lab] 8. sud 프로젝트 구현(3)[C++ lab] 8. sud 프로젝트 구현(3)
[C++ lab] 8. sud 프로젝트 구현(3)
 
[C++ lab] 9. 디버깅 테크닉
[C++ lab] 9. 디버깅 테크닉[C++ lab] 9. 디버깅 테크닉
[C++ lab] 9. 디버깅 테크닉
 
[C++ lab] 2. hello world
[C++ lab] 2. hello world[C++ lab] 2. hello world
[C++ lab] 2. hello world
 
C++ 미정의 행동(undefined behavior)
C++ 미정의 행동(undefined behavior)C++ 미정의 행동(undefined behavior)
C++ 미정의 행동(undefined behavior)
 
[C++ lab] 10. 메모리 누수 체크
[C++ lab] 10. 메모리 누수 체크[C++ lab] 10. 메모리 누수 체크
[C++ lab] 10. 메모리 누수 체크
 
[Pl in c++] 6. battle ship 3
[Pl in c++] 6. battle ship 3[Pl in c++] 6. battle ship 3
[Pl in c++] 6. battle ship 3
 
[C++adv] STL 사용법과 주의 사항
[C++adv] STL 사용법과 주의 사항[C++adv] STL 사용법과 주의 사항
[C++adv] STL 사용법과 주의 사항
 
[1116 박민근] c++11에 추가된 새로운 기능들
[1116 박민근] c++11에 추가된 새로운 기능들[1116 박민근] c++11에 추가된 새로운 기능들
[1116 박민근] c++11에 추가된 새로운 기능들
 
Modern C++ 프로그래머를 위한 CPP11/14 핵심
Modern C++ 프로그래머를 위한 CPP11/14 핵심Modern C++ 프로그래머를 위한 CPP11/14 핵심
Modern C++ 프로그래머를 위한 CPP11/14 핵심
 
동국대 앱창작터 1일차:Cocos2d-X 소개, 환경설정, 주요개념
동국대 앱창작터 1일차:Cocos2d-X 소개, 환경설정, 주요개념동국대 앱창작터 1일차:Cocos2d-X 소개, 환경설정, 주요개념
동국대 앱창작터 1일차:Cocos2d-X 소개, 환경설정, 주요개념
 
유니티의 툰셰이딩을 사용한 3D 애니메이션 표현
유니티의 툰셰이딩을 사용한 3D 애니메이션 표현유니티의 툰셰이딩을 사용한 3D 애니메이션 표현
유니티의 툰셰이딩을 사용한 3D 애니메이션 표현
 

Similar to Python at 10.1

Python en la Plataforma ArcGIS
Python en la Plataforma ArcGISPython en la Plataforma ArcGIS
Python en la Plataforma ArcGIS
Xander Bakker
 
End-to-end Big Data Projects with Python - StampedeCon Big Data Conference 2017
End-to-end Big Data Projects with Python - StampedeCon Big Data Conference 2017End-to-end Big Data Projects with Python - StampedeCon Big Data Conference 2017
End-to-end Big Data Projects with Python - StampedeCon Big Data Conference 2017
StampedeCon
 
Python과 node.js기반 데이터 분석 및 가시화
Python과 node.js기반 데이터 분석 및 가시화Python과 node.js기반 데이터 분석 및 가시화
Python과 node.js기반 데이터 분석 및 가시화
Tae wook kang
 
modm
modmmodm
Koalas: Making an Easy Transition from Pandas to Apache Spark
Koalas: Making an Easy Transition from Pandas to Apache SparkKoalas: Making an Easy Transition from Pandas to Apache Spark
Koalas: Making an Easy Transition from Pandas to Apache Spark
Databricks
 
Munihac 2018 - Beautiful Template Haskell
Munihac 2018 - Beautiful Template HaskellMunihac 2018 - Beautiful Template Haskell
Munihac 2018 - Beautiful Template Haskell
Matthew Pickering
 
Leveraging R in Big Data of Mobile Ads (R在行動廣告大數據的應用)
Leveraging R in Big Data of Mobile Ads (R在行動廣告大數據的應用)Leveraging R in Big Data of Mobile Ads (R在行動廣告大數據的應用)
Leveraging R in Big Data of Mobile Ads (R在行動廣告大數據的應用)
Craig Chao
 
Wprowadzenie do technologii Big Data / Intro to Big Data Ecosystem
Wprowadzenie do technologii Big Data / Intro to Big Data EcosystemWprowadzenie do technologii Big Data / Intro to Big Data Ecosystem
Wprowadzenie do technologii Big Data / Intro to Big Data Ecosystem
Sages
 
Congressional PageRank: Graph Analytics of US Congress With Neo4j
Congressional PageRank: Graph Analytics of US Congress With Neo4jCongressional PageRank: Graph Analytics of US Congress With Neo4j
Congressional PageRank: Graph Analytics of US Congress With Neo4j
William Lyon
 
Robust Operations of Kafka Streams
Robust Operations of Kafka StreamsRobust Operations of Kafka Streams
Robust Operations of Kafka Streams
confluent
 
Using the code below- I need help with creating code for the following.pdf
Using the code below- I need help with creating code for the following.pdfUsing the code below- I need help with creating code for the following.pdf
Using the code below- I need help with creating code for the following.pdf
acteleshoppe
 
R and cpp
R and cppR and cpp
R and cpp
Romain Francois
 
Emerging Languages: A Tour of the Horizon
Emerging Languages: A Tour of the HorizonEmerging Languages: A Tour of the Horizon
Emerging Languages: A Tour of the Horizon
Alex Payne
 
Pythonic Graphics
Pythonic GraphicsPythonic Graphics
Pythonic Graphics
Kirby Urner
 
CLIM Undergraduate Workshop: (Attachment) Performing Extreme Value Analysis (...
CLIM Undergraduate Workshop: (Attachment) Performing Extreme Value Analysis (...CLIM Undergraduate Workshop: (Attachment) Performing Extreme Value Analysis (...
CLIM Undergraduate Workshop: (Attachment) Performing Extreme Value Analysis (...
The Statistical and Applied Mathematical Sciences Institute
 
Getting Started with MongoDB and NodeJS
Getting Started with MongoDB and NodeJSGetting Started with MongoDB and NodeJS
Getting Started with MongoDB and NodeJS
MongoDB
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
Dmitry Buzdin
 
Cbse question paper class_xii_paper_2000
Cbse question paper class_xii_paper_2000Cbse question paper class_xii_paper_2000
Cbse question paper class_xii_paper_2000
Deepak Singh
 
Data analysis with R
Data analysis with RData analysis with R
Data analysis with R
ShareThis
 
Wprowadzenie do technologi Big Data i Apache Hadoop
Wprowadzenie do technologi Big Data i Apache HadoopWprowadzenie do technologi Big Data i Apache Hadoop
Wprowadzenie do technologi Big Data i Apache Hadoop
Sages
 

Similar to Python at 10.1 (20)

Python en la Plataforma ArcGIS
Python en la Plataforma ArcGISPython en la Plataforma ArcGIS
Python en la Plataforma ArcGIS
 
End-to-end Big Data Projects with Python - StampedeCon Big Data Conference 2017
End-to-end Big Data Projects with Python - StampedeCon Big Data Conference 2017End-to-end Big Data Projects with Python - StampedeCon Big Data Conference 2017
End-to-end Big Data Projects with Python - StampedeCon Big Data Conference 2017
 
Python과 node.js기반 데이터 분석 및 가시화
Python과 node.js기반 데이터 분석 및 가시화Python과 node.js기반 데이터 분석 및 가시화
Python과 node.js기반 데이터 분석 및 가시화
 
modm
modmmodm
modm
 
Koalas: Making an Easy Transition from Pandas to Apache Spark
Koalas: Making an Easy Transition from Pandas to Apache SparkKoalas: Making an Easy Transition from Pandas to Apache Spark
Koalas: Making an Easy Transition from Pandas to Apache Spark
 
Munihac 2018 - Beautiful Template Haskell
Munihac 2018 - Beautiful Template HaskellMunihac 2018 - Beautiful Template Haskell
Munihac 2018 - Beautiful Template Haskell
 
Leveraging R in Big Data of Mobile Ads (R在行動廣告大數據的應用)
Leveraging R in Big Data of Mobile Ads (R在行動廣告大數據的應用)Leveraging R in Big Data of Mobile Ads (R在行動廣告大數據的應用)
Leveraging R in Big Data of Mobile Ads (R在行動廣告大數據的應用)
 
Wprowadzenie do technologii Big Data / Intro to Big Data Ecosystem
Wprowadzenie do technologii Big Data / Intro to Big Data EcosystemWprowadzenie do technologii Big Data / Intro to Big Data Ecosystem
Wprowadzenie do technologii Big Data / Intro to Big Data Ecosystem
 
Congressional PageRank: Graph Analytics of US Congress With Neo4j
Congressional PageRank: Graph Analytics of US Congress With Neo4jCongressional PageRank: Graph Analytics of US Congress With Neo4j
Congressional PageRank: Graph Analytics of US Congress With Neo4j
 
Robust Operations of Kafka Streams
Robust Operations of Kafka StreamsRobust Operations of Kafka Streams
Robust Operations of Kafka Streams
 
Using the code below- I need help with creating code for the following.pdf
Using the code below- I need help with creating code for the following.pdfUsing the code below- I need help with creating code for the following.pdf
Using the code below- I need help with creating code for the following.pdf
 
R and cpp
R and cppR and cpp
R and cpp
 
Emerging Languages: A Tour of the Horizon
Emerging Languages: A Tour of the HorizonEmerging Languages: A Tour of the Horizon
Emerging Languages: A Tour of the Horizon
 
Pythonic Graphics
Pythonic GraphicsPythonic Graphics
Pythonic Graphics
 
CLIM Undergraduate Workshop: (Attachment) Performing Extreme Value Analysis (...
CLIM Undergraduate Workshop: (Attachment) Performing Extreme Value Analysis (...CLIM Undergraduate Workshop: (Attachment) Performing Extreme Value Analysis (...
CLIM Undergraduate Workshop: (Attachment) Performing Extreme Value Analysis (...
 
Getting Started with MongoDB and NodeJS
Getting Started with MongoDB and NodeJSGetting Started with MongoDB and NodeJS
Getting Started with MongoDB and NodeJS
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
 
Cbse question paper class_xii_paper_2000
Cbse question paper class_xii_paper_2000Cbse question paper class_xii_paper_2000
Cbse question paper class_xii_paper_2000
 
Data analysis with R
Data analysis with RData analysis with R
Data analysis with R
 
Wprowadzenie do technologi Big Data i Apache Hadoop
Wprowadzenie do technologi Big Data i Apache HadoopWprowadzenie do technologi Big Data i Apache Hadoop
Wprowadzenie do technologi Big Data i Apache Hadoop
 

Recently uploaded

Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 

Recently uploaded (20)

Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 

Python at 10.1

  • 2. Contents • arcpy Enhancements • Add-ins • Python Toolboxes
  • 3. FeatureClassToNumPyArray import arcpy import numpy input = "C:/Data/ABSData.gdb/VIC_CCDs" arr = arcpy.da.FeatureClassToNumPyArray(input,('CCD', 'pop_m', 'pop_f')) # Sum the total population for males & females # print(arr['pop_m'].sum()) print(arr['pop_f'].sum()) # Sum the female population for a particular CCD # print(arr[arr['CCD'] == "2010101"]['pop_f'].sum())
  • 4. FeatureClassToNumPyArray import arcpy import numpy input = "C:/Data/ABSData.gdb/VIC_CCDs" field1 = "INCOME" field2 = "EDUCATION" arr = arcpy.da.FeatureClassToNumPyArray(input, (field1, field2)) # Print correlation coefficients for the two fields print(numpy.corrcoef((arr[field1],arr[field2])))
  • 5. Improved Cursors # Turn the contents of a GDB table into a Python list of lists # Simple syntax & little code with arcpy.da.SearchCursor(zonalstats_results_table, ["MINORITY","MAJORITY","MEAN"]) as tblcur: results = [r for r in tblcur]
  • 6. Improved Cursors import arcpy arcpy.env.workspace = "c:/data/output.gdb" fc = "c:/data/base.gdb/roads" fields = ("ROAD_TYPE", "BUFFER_DISTANCE") with arcpy.da.UpdateCursor(fc, fields) as cursor: # Update the field used in Buffer so the distance is based on road # type. Road type is either 1, 2, 3 or 4. Distance is in meters. for row in cursor: row[1] = row[0] * 100 cursor.updateRow(row)
  • 7. arcpy.mapping: update/apply symbology import arcpy mxd = arcpy.mapping.MapDocument(r"C:ProjectProject.mxd") df = arcpy.mapping.ListDataFrames(mxd, "Census")[0] lyr = arcpy.mapping.ListLayers(mxd, "StatePopulation", df)[0] lyrFile = arcpy.mapping.Layer(r"C:ProjectLYRsPopulation.lyr") arcpy.mapping.UpdateLayer(df, lyr, lyrFile, True) if lyr.symbologyType == "GRADUATED_COLORS": lyr.symbology.valueField = "POP2000" lyr.symbology.classBreakValues = [250000, 999999, 4999999, 9999999, 35000000] lyr.symbology.classBreakLabels = ["250,000 to 999,999", "1,000,000 to 4,999,999", "5,000,000 to 9,999,999", "10,000,000 to 35,000,000"] arcpy.mapping.ExportToPDF(mxd, r"C:ProjectOutputStatePopulation.pdf") del mxd, lyrFile

Editor's Notes

  1. ** da module - to numpy array- what's numpy?- can convert values from a feature class to a numpy array- this allows lots of things straight-up like very fast column-based summary statistics (can take the mean of a column) or manipulation of all fields/rows at once (ever needed to multiply all values in all fields by 10?)- numpy arrays are the native datatype of many scipy & related libraries. allows for good extension of functionality- even better, easy(er) transfer to-from R
  2. ** da module - fast cursors- cursors have been vastly improved; 30x faster for SearchCursor, >10x faster for insert- support "with" keyword for setup/teardown; prevents locks- have some funky shape properties accessors (centroid, x, y etc)- different syntax - requires a rewrite, not find-replace (fields req'd)
  3. ** improved mapping module- can specify basic layer symbology e.g. graduated colours, symbols, unique vals, raster classifications- can apply legend styles- automatically create server connections (deployable)
  4. ** Difference between add-ins & script tools- addins involve a toolbar- user interaction e.g. click on feature, drag envelope, type in address- anything that requires dynamic interaction is better as an addin** How to make/distribute them- have a "template wizard" which sets up the folder structure & basic classes- fills in the config.xml which could be edited directly- ultimately just a .zip file with a different extension** List of functions/events you can use- Can capture following events: - dbl-click - circle, rectangle, line - info about mouse click: - which button - map OR screen coordinates on mouse-down or mouse-up - whether a modifier (shift, ctrl, alt) was present - keypress captures (incl. modifiers)- All these can be fed into your tool logic. Could generate custom editing, extraction, interactive geoprocessing, etc.
  5. ** What they are- .pyt file- Just a Python script with specific classes- ArcGIS understands them as a Toolbox- Incorporates everything: parameter info, descriptions, validation, program logic** Advantages over "normal" toolboxes- Easier to deploy- Easier to maintain - can actually have >1 person editing at once, with proper version control!- Could theoretically generate them automatically... with different tools according to some parameters. We used to have to make >1 toolbox with subsets of tools, this would have helped- No worrying about relative paths/python files going missing/models losing their sub-models