当前位置:网站首页>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
边栏推荐
- Go的Gin框架学习
- Flask项目的部署详解
- Client example analysis of easymodbustcp
- ES6 new method
- Land cover / use data product download
- Transfer learning of five categories of pictures based on VGg
- Anchor location - how to set the distance between the anchor and the top of the page. The anchor is located and offset from the top
- C language implements memcpy, memset, strcpy, strncpy, StrCmp, strncmp and strlen
- String function in MySQL
- 编译原理 求first集 follow集 select集预测分析表 判断符号串是否符合文法定义(有源码!!!)
猜你喜欢

Classification of cifar100 data set based on convolutional neural network

.105Location

2022 judgment questions and answers for operation of refrigeration and air conditioning equipment

2022年茶艺师(初级)考试模拟100题及模拟考试

Eigen learning summary

Gaode map search, drag and drop query address

Go对文件操作

Implementation of k8s redis one master multi slave dynamic capacity expansion

Applet learning notes (I)

Go language JSON package usage
随机推荐
Basic usage of crawler requests
极致体验,揭晓抖音背后的音视频技术
C network related operations
Generate verification code
读取excel,int 数字时间转时间
String function in MySQL
Go语言JSON包使用
Flash - Middleware
Write a regular
2022制冷与空调设备运行操作判断题及答案
2022 Jiangxi Photovoltaic Exhibition, China Distributed Photovoltaic Exhibition, Nanchang Solar Energy Utilization Exhibition
MySQL 中的字符串函数
Arithmetic expression
JS forms the items with the same name in the array object into the same array according to the name
YOLOv4剪枝【附代码】
re正則錶達式
vite配置proxy代理解决跨域
2022 Shanghai safety officer C certificate operation certificate examination question bank and simulation examination
JS implementation private attribute
Selenium + phantom JS crack sliding verification 2