I have two files:
- a shapefile called:
- from the ZonalStatisticsAsATable-function a .dbf-file:
In the .dbf-file is a coloumn in which I am interested. It is the
MEAN-coloumn. I want to join that field to the shapefile. Since I am forced to use the shapefile (there is no way a GDB is possible), I wanted basically to join the
MEAN-coloumn to the shapefile and change then the name to
Fox_Mean. Here is my code:
Habitat="C:\\Files\\Habitat.shp" ZonalStatisticsOutputTable="C:\\Files\\ZonalStatisticsTable.dbf" arcpy.JoinField_management(Habitat, "ZoneID", ZonalStatisticsOutputTable, "ZoneID", "MEAN") arcpy.AlterField_management(Habitat, "MEAN", "Fox_Mean")
However since I am working on a shapefile the
AlterField_management-tool does not work.
Is there any other way of renaming that
MEAN-field without using GDB or any other additional library?
I thought maybe about simply renaming the
MEAN-field in the .dbf-file, but then a new library is needed. An alternative would maybe be to just copy the content of the coloumn to a new field and delete the
MEAN-field then. However I am unsure if that does not screw everything up.