当前位置:网站首页>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
边栏推荐
- Yolov4 pruning [with code]
- [UDS unified diagnostic service] v. diagnostic application example: Flash bootloader
- EasymodbusTCP之clientexample解析
- [UDS unified diagnostic service] (Supplement) v. detailed explanation of ECU bootloader development points (2)
- JS parsing and execution process
- Halo open source project learning (II): entity classes and data tables
- QTableWidget使用讲解
- In JS, t, = > Analysis of
- cartographer_ There is no problem compiling node, but running the bug that hangs directly
- k8s之实现redis一主多从动态扩缩容
猜你喜欢
[UDS unified diagnostic service] v. diagnostic application example: Flash bootloader
极致体验,揭晓抖音背后的音视频技术
An example of linear regression based on tensorflow
云原生虚拟化:基于 Kubevirt 构建边缘计算实例
On the method of outputting the complete name of typeID from GCC
Clion installation tutorial
Transfer learning of five categories of pictures based on VGg
The JS timestamp of wechat applet is converted to / 1000 seconds. After six hours and one day, this Friday option calculates the time
The ultimate experience, the audio and video technology behind the tiktok
[UDS unified diagnostic service] (Supplement) v. detailed explanation of ECU bootloader development points (1)
随机推荐
C1 notes [task training part 2]
C# 的数据流加密与解密
Comparison between xtask and kotlin coroutine
Qtablewidget usage explanation
Romance in C language
Halo 开源项目学习(二):实体类与数据表
Operators in C language
Type judgment in [untitled] JS
.105Location
C language input and output (printf and scanf functions, putchar and getchar functions)
Applet learning notes (I)
positioner
SystemVerilog (VI) - variable
Process management command
Data stream encryption and decryption of C
ES6 new method
C byte array (byte []) and string are converted to each other
On the method of outputting the complete name of typeID from GCC
Utilisation de la liste - Ajouter, supprimer et modifier la requête
ROS package NMEA_ navsat_ Driver reads GPS and Beidou Positioning Information Notes