Questions tagged [nested-json]

114 questions
1
vote
1 answer

update or add new field in a nested dictionary in Python

I am trying to update or to add a new key with its value in a python dictionary ( it is a nested dictionary). Basically this dictionary is coming from an API. the first call, the API responds with the initial dictionary which is like that…
jimjim32
  • 13
  • 2
1
vote
1 answer

Nested JSON using MySQL

I am trying to use MySQL to query a column 'XYZ' and the value of column 'XYZ' is like a nested JSON as shown below { "sng_ecommerce_purchase_revenue": {"7d": 18}, "unique_sng_content_view": {"7d": 25}, "Unique_login_send_otp": {"7d": 22.0}, …
King
  • 41
  • 4
1
vote
1 answer

Trying use a prompt to parse and find specific keys in nested JSON file

I'm attempting to parse a dynamic complex nested JSON file, where the result would be finding the specific key in an array. Here's a snippet of non-working code: if (input == 'Special Weather Statement') { var url =…
kait0216
  • 13
  • 3
1
vote
2 answers

Combining duplicate key and value pairs in json using python

I want to combine duplicate key and value pairs in JSON dictionaries. I am having trouble doing that. As other keys are not the same and are repetitive. I have the following JSON format: [ { "date":"2018-12-01", "9":{ …
1
vote
0 answers

Nested JSON with query table from database

Below is the data from database table after query. Query is mentioned below in repository code. +-----------+-----------+----------+ | Year | Name | Count | +-----------+-----------+----------+ | 2020 | Motor | 12 | |…
781995
  • 21
  • 3
1
vote
1 answer

Pandas Dataframe manipulation for nested json

I am new to python and I need to manipulate a little the following df. What I basically need is to move from…
gtcl
  • 11
  • 3
1
vote
2 answers

Find Nested Json Path with key using python

I am trying to find all the full path for specific key. I tried with recursion, i can able to get the values, but i can't able to track the path using my code. Any Help will definitely useful for me. Input: { "id": ["0001"], "type": "donut", …
NAGA RAJ S
  • 452
  • 4
  • 12
1
vote
2 answers

Convert a flattened excel to nested json in pandas

I am fairly new to this and have spent the entire day reading numerous posts and figuring out how i can convert this flattened excel table to a nested json. Here is an example of the flattened nested table: {'Sample': {0: '1A', 1: '1A', 2:…
dannyboy
  • 11
  • 4
1
vote
1 answer

Send nested JSON data with image/file from postman: Django REST framework

I want to POST the following data: { "user": { "name": "user name", "email": "user@example.com", "phone_number": "01XXXXXXXXX", "user_type": "MGR" }, "img": "image_data", "manager_brands": [ …
1
vote
2 answers

Using Spark converting nested json with optional fields to Scala case class not working

I have a use case where I need to read a json file or json string using spark as Dataset[T] in scala. The json file has nested elements and some of the elements in the json are optional. I am able to read the json file and map those to case class if…
1
vote
0 answers

How to ignore key in nested JSON (because it has variable name)

I have following JSON, where element "Key_with_variable_name" has variable name compared to other keys: { "Key1": { "Key11": { "Key111": "Value111", "Key112": "Value112", "Key113": "Value113", …
pc131
  • 53
  • 2
  • 5
1
vote
0 answers

How to nest json objects in nodejs

I have created a nodejs backend project with mongodb as the database. I want to create a document where it stores details of multiple students. Below shows my controller and model files. Controller.js const _user = new User({ username:…
Anna
  • 11
  • 3
1
vote
2 answers

Flatten a tripled nested json into a dataframe

Problem I was given a pretty big json file that looks like this minimal example: json_file = """ { "products": [ { "id":"0", "name": "First", "emptylist":[], "properties" : …
Edo
  • 7,567
  • 2
  • 9
  • 19
1
vote
1 answer

How to work with nested json and perform lookup

I have a nested json file and a dictionary(params) for lookup, I would like to replace record dict value where format "<>" is present with lookup. lookup dictionary: params_lookup = {"population":47, "year":2022, "valid":True, "end":"colls",…
kites
  • 1,375
  • 8
  • 15
1
vote
1 answer

How to write table data into a nested struct in Go

Summary I am trying to write data from several postgres tables into a nested Go struct for the purpose of returning a single json response to a GET request within my web app. Questions Is the way I'm declaring a nested struct reasonable from a Go…
user2781522
  • 119
  • 10