Skip navigation
All People > Dan_Patterson > Py... blog > 2019 > November

So simple.

But you have to be diligent.



Start when you first create the tables or featureclasses.


Now how many of you knew this was possible?

Solves your <null> problems since you will have to provide a valid nodata value, something which has meaning.


Python's math and numpy modules support the concept of NaN  (not a number) .

Nan's are omitted in numeric calculations by functions that ignore them... automagically... eg. mean, vs nanmean


Text... never use "" or '' because you can't see them. If you are recording textual information, provide appropriate classes like .... "never measured", "not at home", "forgot", "wasn't me", "Nadda",  or even "NONE" as text in all caps to differentiate it from the real None.


Think about this next time you decide to work with tabular data.



It is nice that you can view geometry in ArcGIS Pro.


Ditto for notebooks in your browser.


But I really hate cranking up a new featureclass when I am working on a geometry exploration, when all I want to see is what the numbers actually look like.


I stumbled on this when I was working on my npgeom package, which uses an alternate geometry constructor than is used in the arc* line of products.  It also deconstructs geometry using arcpy data access cursors and/or  FeatureClassToNumPyArray.   (Thas is another story though)


In short, I was doing my thing and got 3 polygons objects from a featureclass.

Lines 78-80... blah blah, stuff comes out

Line 81 ... wanted to make sure they were polygon objects.... indeedy they were

Line 82, 83, 84 (right side of graphic)

   cool!  perfect polygons

       [82] A multipart polygon with 2 holes in the first part and 1 in the second

       [83] Another multipart, 3 holes in one, none in the other

       [84] The triangle, paying homage to a simpler time when geometry deconstruction was easier



I won't go into details, but my python setup is noted at the bottom of the callout in the graphic.


More details when I explore more.  Going to replicate this as a *.ipynb for use in the browser AND with Spyder as well.

Hopefully other python IDEs support these as well.  Some use qt and mpl in their graphics display arsenal.



I did forget to mention that you can save the contents of the qt console in spyder to a couple of formats for posterity.

I save a little sample in the attached zip file.. 

  • unzip it to a location (eg. c:\temp
  • double-click on the npg_01.html file and it should load in your browser

Of course you can edit the html file to fix any stuff that you want.


You can save to svg format as well (see attached)


You people had better get back to work