How do I convert a field value to NULL? I tried Calculate. Not sure how to use Python = "none" but I could not get it to work.
Thanks.
Stew
Try "None" without surrounding quotes (it's also case-sensitive).
for vector geometry, I simply use numpy arrays with np.nan and I can convert back and forth between arc* geometry using a variety of means.
But I suspect this should be a separate thread
Ok, really wasn't considering the point(geometry) fields. So while for non point(geometry) fields perhaps is a good idea to consider np.nan, for point(geometry) fields go with math.nan accordingly.
This has also been brought up before in the context of geometry definitions, but probably too late to implement any changes
https://community.esri.com/blogs/dan_patterson/2018/01/12/point-of-view-on-points
If you are trying to handle missing data usually Data Scientists like me advise to use np.nan because of this:
python - What is the difference between NaN and None? - Stack Overflow
for consistency i would recommend this:
myfieldvalue=np.nan otherwise you can do else.
Stewart... also remember in Python and for fields that are 'nullable'
there is only one .... None ....
you use it for all field types... text, numbers etc
https://community.esri.com/blogs/dan_patterson/2015/04/17/none-isntnor-is-0-or-1-more-explorations-into-geometry
https://community.esri.com/blogs/dan_patterson/2016/11/03/before-i-forget-18-those-pesky-null-things
https://community.esri.com/blogs/tilting/2015/05/29/whats-in-your-feature-class-nothing-null-or-empty
and who said there is nothing more to learn about nothing
Reply to all,
Thanks very much for the help! There were two parts to the solution using the Field Calculator to enter "None".
1) case-sensitive2) use the python parser
Python is very user friendly
😮 But it is so readable and understandable unlike Python
maybe something like this.
In above example, the value of 0 is replaced by <Null>
don't encourage vb Joe
Null in VB.
In summary, make sure the field is nullable and you use the python parser when typing ... None ....
since None is a python object for sure... not sure about other parsers.
Do you check if the field is nullable or not?
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.