I would like to use numpy array from a excel file for a selection of features. Do I have to convert the array to a list first, and how to do that? With the following code I get the following error? Or some better ideas, many files to select?
import numpy as np
import arcpy
import pandas as pd
import sys, os
stdout_encoding = sys.stdout.encoding or sys.getfilesystemencoding()
inTable = r"R:\Karto\Bierer2019\FFH_MEKA_FACT\Tabellen\wk13.xlsx"
outP = r"R:\Karto\Bierer2019\FFH_MEKA_FACT\Shape"
fc = r"\\RPKSF001\GIS_DATA\ArcUISTools15\Data\UIS_ALk.gdb\UIS_0100000047100001"
fl = "ALK"
Flrstkz = pd.read_excel(inTable, index_col=None, na_values=['NA'], parse_cols = "A")
x = np.array(Flrstkz)
arcpy.MakeFeatureLayer_management(fc, fl)
field = 'FLURSTUECKSKENNZEICHEN'
for i in x:
print i
sc = "%s = + %s"(field, i)
print sc
arcpy.SelectLayerByAttribute_management (fl, "NEW_SELECTION", sc)
outFc = os.path.join(outP, "WK13_"+ i + ".shp")
arcpy.CopyFeatures_management(fl, outFc)
[8334100002890000384]
Traceback (most recent call last):
File "R:/Karto/zGIS/Python_2019/NumPy/NumPY_MEKA_FAKT.py", line 30, in <module>
sc = "%s = + %s"(field, i)
TypeError: 'str' object is not callable
Better would be the "quercy" in (np.array)?