Can you run an ArcGIS Pro script in PowerBI transform data Python editor? A sample code has been provided below? Yes, I have already set the PBI Py environment to ArcGIS Pro.
import arcpy
# To allow overwriting outputs change overwriteOutput option to True.
arcpy.env.overwriteOutput = True
# Import the projects geodatabase table subset
in_df = r"O:\MyProject.gdb\Projects_City"
arcpy.management.CreateTable(
out_path=r"O:\MyProject.gdb",
out_name="Projects_City_Updated",
template=in_df,
config_keyword="",
out_alias=""
)
out_df = r"O:\MyProject.gdb\Projects_City_Updated"
fldlst = ["PRJTID", "MUNICIPALI", "ZIPCODE"]
with arcpy.da.InsertCursor(out_df, fldlst) as insertCursor:
with arcpy.da.SearchCursor(in_df, fldlst) as searchCursor:
for row in searchCursor:
for z in zip(*(str.split(i.replace(" ", ""), ",") for i in row[1:])):
insertCursor.insertRow(row[0:1] + z)
Question | Analyze | Visualize