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?

  • If you could post an issue at github.com/pysal/libpysal and add the files, we could take a look to see what is going on.
    – Serge Rey
    Dec 16, 2019 at 0:18
  • The error as was on my end after all, see my answer.
    – hexamon
    Dec 16, 2019 at 7:49

1 Answer 1


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.


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.