I have a table of points that looks something like this:
year, latitude, longitude
2018, 42.02, -87.68
2018, 41.91, -87.78
2018, 41.64, -87.68
2017, 41.63, -87.56
2017, 41.89, -87.67
2017, 41.67, -87.80
Which I used Import XY to import from CSV as a set of points.
Now I want to perform some operation on it, but looping over the year attribute.
So far I got something like this:
import arcpy
imported_points = "imported_points.shp"
for yr in (2017, 2018):
new_file = "poly_" + yr + ".shp"
arcpy.SelectLayerByAttribute_management(imported_points ,
"NEW_SELECTION",
"[year] = " + yr)
# Some operation, using this as an example
arcpy.DirectionalDistribution_stats(imported_points , new_file, "2_STANDARD_DEVIATIONS", "#", "#")
However, when I try this I get the following error:
ExecuteError: Failed to execute. Parameters are not valid.
The value cannot be a feature class
ERROR 000840: The value is not a Raster Layer.
ERROR 000840: The value is not a Mosaic Layer.
Failed to execute (SelectLayerByAttribute).
What does this mean? What is the best way to do some operation like this?