Skip to content

Tag: json

How to use multistep mrjob with json file

I’m trying to use hadoop to get some statistics from a json file like average number of stars for a category or language with most reviews. To do this I am using mrjob, I found this code: It allows to find the most used word, but I am not sure how to do this with json attributes instead of words.

Convert a CSV into a JSON using a JSON Schema

How do I convert a flat table into a JSON? I have previously converted JSONs into Flat Tables using both custom code and libraries. However, what I am aiming to do here is the reverse. Before going ahead and creating a custom library, I was wondering if anyone had encountered this problem before and if there …

How to get json text by request with header details?

I would like to go to page https://losoviny.iamroot.eu/part_one and write json text from there. End at first I must login in https://losoviny.iamroot.eu/part_one_login and use details in header. But if If I run code I see: raise JSONDecodeError(“Expecting value”, s, err.value) from None json.decod…

How do I apply my function to all the values within a JSON file?

I have a JSON file with the following data: Whereby I want my output to be as follows: This is the code that I currently have, however it only works for the first part of the JSON file and does not iterate over all the other values: When I do run the above code the output is as follows: Question

deserialize json with objects

In python 3, how can I deserialize an object structure from json? Example json: Here’s my python code: How to force some_object to be of type B and some_list_of_objects to be of type list of C? Answer As you’re using Python 3, I would suggest using dataclasses to model your classes. This should im…