Skip to main content

All Questions

Tagged with
0 votes
1 answer
37 views

Deserializing JSON list into class objects not able to extract attributes

I'm struggling to deserialize my json-file into an array of objects of my class LeagueAcc. I wanna fill a list with objects of class LeagueAcc called: accounts = [] I have loaded my JSON successfully ...
Peter K's user avatar
  • 59
1 vote
0 answers
29 views

How can I recreate a request in python since I have only it's log?

I'm writing a Python script to load a collection of logs from API requests. I need to reissue these requests in debug mode to fetch additional information that is not available in the original logs ...
A. Curvina's user avatar
0 votes
2 answers
1k views

Python : `variables` in a POST body should be provided as an object, not a recursively JSON-encoded string

I'm using the following method to insert a variable into a POST request body : def get_variables(date): return '{{"date":"{0}","timezone":"Europe"}}'.format(...
Amy Finland's user avatar
-1 votes
1 answer
60 views

From Json [{"Keys": "Values"}], how to fetch VALUES from .json file [closed]

[ { "Key": "VAlUE" }, { "Key": "VAlUE" } ] Question:- returns Values as ouptut not key.
naman agarwal's user avatar
-1 votes
1 answer
38 views

want to genertate complex desired list of object using list and python

I want to generate data based on some rules and on in the unique structure can't know how to do it, any help would be appreciated it i have two list: categories = [ 'fruits' 'meats' ] and ...
test new jiras 's user avatar
1 vote
3 answers
102 views

how can match two list and remove duplicate based on condition on dictionary in list

I want to merge two lists and get data matched without duplicates and to alias them to new structure I have two lists here is a given two list try to merge cats = [ 'orange', 'apple', 'banana' ] ...
test new jiras 's user avatar
-1 votes
3 answers
60 views

Create an object from a json value

I have a json file (estate.json) that looks like this: { "type": "FeatureCollection", "features": [ { "type": "Feature", "id&...
MathiasF78's user avatar
-1 votes
1 answer
36 views

Accessing second Json javascript object sub array

Assuming this return jscipt request.jon object [ { "code": 20, "country": "US", "intldes": "1959-007A", "...
dinorse's user avatar
1 vote
1 answer
1k views

Python json to object from model

I know this looks like Frequency Ask Question mainly this question: How to convert JSON data into a Python object? I will mention most voted answer: import json from types import SimpleNamespace data ...
Citra Dewi's user avatar
2 votes
5 answers
124 views

How to filter and print particular json dictionaries in python

I'm in the process of learning python. I encountered a problem with json that I can't overcome. I have this dataset from json in python: { "Sophos": { "detected": true, ...
k1np3r's user avatar
  • 25
0 votes
1 answer
24 views

How to pull out specific elements in a json file and store them in another dictionary? How to properly Iterate through dictionary/json file?

I have a Json file that I am trying to pull out certain values and not touch some of the others. The only way I can seem to pull out values is by appending them to a list, which I can only access one ...
TheDude's user avatar
  • 27
0 votes
1 answer
134 views

Convert Python Class with Inner Classes and Static Attributes to JSON

I am trying to convert the following to json. @dataclass class Attribute: name: str description: str class A: class B: attr1 = Attribute(name="attr1",description="...
BigL's user avatar
  • 163
0 votes
1 answer
732 views

How to update json object in a loop?

My end goal is to have a json file in a variable that can be passed to an API. Right now, I can't get the JSON to update how I want it to in the loop. How can I get it to output/append all the options ...
H14's user avatar
  • 15
0 votes
1 answer
68 views

Why is this For Loop overwriting the contents of my dictionary strangely?

I am trying to convert my pandas DataFrame data into a different medium which is easily represented via JSON. I have chosen to do this by turning it into python dictionaries then converting it into ...
mfm's user avatar
  • 28
0 votes
1 answer
41 views

how to delete an empty list in an array object in python?

I have this as data store_list = { "ECG 12D":[], "ETT Adulte":[ {"series":"Série sans label","modality":"OT",&...
Julien T-Pro's user avatar

15 30 50 per page
1
2 3 4 5
10