0

I'm reading a Shapefile with PySAL in order to do some anlysis. The shapefile's DBF contains three columns, "id", "count" and "population". All three are large integers with no Null values.

I try to prepare variables with the following code:

cnt = data.by_col_array('count')
pop = data.by_col_array('population')

cnt works fine and returns with the expected values, but pop becomes an array filled with None types. I write the shapefile with FME and have verified that there are no missing values and the datatypes are the same. Looking at the file in QGIS it shows up fine.

Is there any obvious place to start looking here?

0

If you could post an issue at https://github.com/pysal/libpysal and add the files, we could take a look to see what is going on.

| improve this answer | |
  • The error as was on my end after all, see my answer. – hexamon Dec 16 '19 at 7:49
0

It turns out it was a data error after all. Despite all my checks, a dash had snuck into one row which messed up the datatype.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.