I have a table imported from Excel that has three attribute columns (City, State, ZIP) as well as X/Y columns that have been added.
I have a cursor that goes through the records in the table and creates points
point = arcpy.Point() pointGeometryList =  with arcpy.da.SearchCursor("in_memory/xxExcelOutput", ["POINT_X", "POINT_Y", "CITY", "STATE", "ZIP_CODE"]) as cursor: for row in cursor: point.X = row point.Y = row pointGeometry = arcpy.PointGeometry(point) pointGeometryList.append(pointGeometry) arcpy.CopyFeatures_management(pointGeometryList, "in_memory/pointFC")
How can I add the attributes from my table when I create the points? I know the following doesn't work, but is there a way to do it within the same cursor?
for row in cursor: point.X = row point.Y = row point.ZIP = row
The only way I've come up with so far is to AddField() to the new feature class, and then UpdateCursor() the extra attributes with another search cursor. While this way works OK for my test data (I have some data in my table, for proof of concept), I am concerned that I may end up with multiple points in the same location that have different attributes - I need to ensure that each point is created with the matching attributes.