I changed the code in this, but have problems to code the selection quercy properly.
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
#
import numpy as np
import arcpy
import pandas as pd
import sys, os
# Encoding der Standardausgabe herausfinden
stdout_encoding = sys.stdout.encoding or sys.getfilesystemencoding()
arcpy.env.overwriteOutput = True
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"
# Tabelle
Flrstkz = pd.read_excel(inTable, index_col=None, na_values=['NA'], parse_cols = "A")
x = np.array(Flrstkz)
x1 = np.array(map(str, x))
x2 = x1.tolist()
field = 'FLURSTUECKSKENNZEICHEN'
sc = "'" + field + " IN ({})".format(x2) + "'"
sc1 = sc.replace("[", "")
sc2 = sc1.replace("]", "")
print sc2
arcpy.MakeFeatureLayer_management(fc, fl)
arcpy.SelectLayerByAttribute_management (fl, "NEW_SELECTION", sc2)
outFc = os.path.join(outP, "ALK_WK13.shp")
arcpy.CopyFeatures_management(fl, outFc)
Line 28 is somehow wrong. The print of sc2 looks like this:
'FLURSTUECKSKENNZEICHEN IN ('8334100002890000384', '8334100002890000384', '8334100002890000384', '8334100002890000384')'
but gives a error in Line 37? Invalid expression?