Why can't Python parse this JSON data?

后端 未结 9 2480
傲寒
傲寒 2020-11-21 05:06

I have this JSON in a file:

{
    \"maps\": [
        {
            \"id\": \"blabla\",
            \"iscategorical\         


        
9条回答
  •  再見小時候
    2020-11-21 05:39

    "Ultra JSON" or simply "ujson" can handle having [] in your JSON file input. If you're reading a JSON input file into your program as a list of JSON elements; such as, [{[{}]}, {}, [], etc...] ujson can handle any arbitrary order of lists of dictionaries, dictionaries of lists.

    You can find ujson in the Python package index and the API is almost identical to Python's built-in json library.

    ujson is also much faster if you're loading larger JSON files. You can see the performance details in comparison to other Python JSON libraries in the same link provided.

提交回复
热议问题