Extract surface and keep numbering

If you want to save your data as a specific format, not yet supported by ParaView, and you want to write in python, you should use a python programmable filter.

https://www.paraview.org/Wiki/Python_Programmable_Filter