当前位置:网站首页>Arcpy adds fields and loop assignments to vector data
Arcpy adds fields and loop assignments to vector data
2022-04-23 18:00:00 【Be happy to study today】
Arcpy Add fields to vector data and cycle through modifying values or assignments
As the title shows , What has been generated Arcmap Some simple operations for assignment in the vector attribute table are possible , But I want to add Excel A new column of data in the table needs to use Arcpy To handle . Can be ahead of time in Arcmap Build fields in , Or directly create a new field :
#coding:utf-8
import arcpy
import numpy as np
filename = r'E:\bjdata\data'
arcpy.env.workspace = filename
# path = r"E:\bjdata\result(1000,15).xlsx"
path = r"C:\Users\mianmian\Desktop\result.csv"
wdata=np.genfromtxt(path,delimiter=",") # open Excel file
x=wdata[:,13]; # The first 13 Column , All line data
# print(x)
shp_path = r'E:\bjdata\rightbjnet.shp'
cursor = arcpy.UpdateCursor(shp_path)
i = 1
for my_row in cursor:
my_value = my_row.getValue('result')
# print(my_value)
my_row.setValue('result', float(x[i]))
cursor.updateRow(my_row)
i += 1
print(my_value)
版权声明
本文为[Be happy to study today]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230545528514.html
边栏推荐
- 587. 安装栅栏 / 剑指 Offer II 014. 字符串中的变位词
- Compilation principle first set follow set select set prediction analysis table to judge whether the symbol string conforms to the grammar definition (with source code!!!)
- Summary of common server error codes
- cv_ Solution of mismatch between bridge and opencv
- Clion installation tutorial
- 极致体验,揭晓抖音背后的音视频技术
- Flask项目的部署详解
- Generate verification code
- C language loop structure program
- SystemVerilog(六)-变量
猜你喜欢

The ultimate experience, the audio and video technology behind the tiktok
![Click Cancel to return to the previous page and modify the parameter value of the previous page, let pages = getcurrentpages() let prevpage = pages [pages. Length - 2] / / the data of the previous pag](/img/ed/4d61ce34f830209f5adbddf9165676.png)
Click Cancel to return to the previous page and modify the parameter value of the previous page, let pages = getcurrentpages() let prevpage = pages [pages. Length - 2] / / the data of the previous pag

Nat Commun|在生物科学领域应用深度学习的当前进展和开放挑战

Random number generation of C #

Using files to save data (C language)

The JS timestamp of wechat applet is converted to / 1000 seconds. After six hours and one day, this Friday option calculates the time

.104History

Go对文件操作

C network related operations

Transfer learning of five categories of pictures based on VGg
随机推荐
vite配置proxy代理解决跨域
C# 的数据流加密与解密
Auto.js 自定义对话框
JS high frequency interview questions
Oil monkey website address
Generate verification code
Nanotechnology + AI enabled proteomics | Luomi life technology completed nearly ten million US dollars of financing
MySQL_ 01_ Simple data retrieval
C1 notes [task training chapter I]
2022 tea artist (primary) examination simulated 100 questions and simulated examination
JS get link? The following parameter name or value, according to the URL? Judge the parameters after
Re regular expression
ES6
Clion installation tutorial
2022年上海市安全员C证操作证考试题库及模拟考试
Auto. JS custom dialog box
消费者灰度实现思路
C network related operations
EasymodbusTCP之clientexample解析
Identification verification code