Skip to content
Advertisement

Error while reading a JSON file with Python Polars

I am trying to read a GeoJSON with Python Polars, like this:

JavaScript

The error I get is:

JavaScript

I have also tried to put the same content into a file and I had a similar error.

As suggested in GitHub, I tried to read the file via Pandas, like this:

JavaScript

The error I get is:

JavaScript

What can I do to read the GeoJSON file?

Advertisement

Answer

If you read the file with pandas you get columsn of type Object where one is not known to Arrow (it could be anything).

If we cast the columns to type string we know that arrow and polars can deal with it.

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement