Azad Rasul
SmartRS

SmartRS

19- Delete a column of vector layer attribute

Azad Rasul's photo
Azad Rasul

Published on Jun 25, 2021

1 min read

Subscribe to my newsletter and never miss my upcoming articles

Firstly, open a shapefile that has an attribute table.

To delete the third column of the table use this code:

layer = iface.activeLayer()
layer.startEditing()
layer.deleteAttribute(2)
layer.commitChanges()
 
Share this
Proudly part of