Skip to main content
5 votes
1 answer
100 views

Consider the following snippet: from collections import UserDict class D(dict): ... d = D(foo="bar", baz=42) print(d.popitem()) # ('baz', 42) class UD(UserDict): ... ud = UD(foo="...
maejam's user avatar
  • 53
-4 votes
0 answers
35 views

This post is followup to Nested dict with parent/child relation,, which was closed due to duplication. However, after 3 days....I will give it a try again. To problem is following. I am trying to sort ...
erotski's user avatar
  • 21
Advice
2 votes
5 replies
63 views

I am working with a dictionary in Python and trying to use the .items() function to get the key-value pairs. I saved the result in a variable l, but when I try to access the first element using l[0], ...
Talha's user avatar
  • 1
1 vote
1 answer
58 views

I am trying to fetch JSON data from an HTTP API and convert it into an in‑memory table in DolphinDB. The JSON response is an array of objects, and I want to store it as a table where each object ...
Gerard Kane's user avatar
Advice
0 votes
4 replies
105 views

i would like to ask for some kind of projects in python that will help me get better at handling dict and lists i'm still not feeling very comfortable with these. If anybody knows a site for training ...
iShareInspiration's user avatar
-1 votes
0 answers
112 views

Note: Someone in the first iteration of this question said that CheckForMagicPoint() is being called every frame, but it is not, as checkingForMagicPoints is only set to true when someone is using the ...
4D-PASTA's user avatar
-7 votes
0 answers
67 views

dic2={'26MC01':{'Name':'Plato', 'Course':'MCA', 'Current Semester':'2nd', 'Graduation Year':'2027'}, '26MC02':{'Name':'Jupiter', 'Course':'MBA', 'Current Semester':'2nd', 'Graduation Year':'...
Prem's user avatar
  • 1
1 vote
1 answer
58 views

How do you turn a list of lists (2-dimensional) into a list of dicts in Ansible? I don't see how I can map it. Take this list: parent_list: - - "value1-1" - "value1-2" - - &...
hydrian's user avatar
  • 155
2 votes
2 answers
83 views

My database includes treatments (treatment_id) that are given to patients at different times during the day (due_time). I would like to display this in a GUI where each treatment has its own row and ...
James Agnew's user avatar
1 vote
3 answers
68 views

I'm tying find good a way to split multiple FQDN domain names from a list of domains in ansible. I need to split the domain name and the unqualified name into a dictionary. input_fqdns: - 'host1....
hydrian's user avatar
  • 155
-4 votes
1 answer
91 views

To what json object will the following java objects get converted / serialized when using jackson mapper? List<String> textList = new ArrayList<>; textList.add("one"); textList....
Andreas Panagiotidis's user avatar
Best practices
3 votes
10 replies
235 views

I have two Python dictionaries, d1 and d2. Let them be: d1 = {'a': 1, 'b': 2} d2 = {'a': 3, 'b': 4} Those dicts would be united as a new one, say new_dict: new_dict = {1: {'a': 1, 'b': 2}, 2: {'a': 3,...
Carlos Gouveia's user avatar
-3 votes
3 answers
118 views

I have created a map like this: map<string, map<string, map<int, vector<int>>>> example; I can insert a value to this map like this: example["Stack"]["OverFlow&...
user32366208's user avatar
-1 votes
1 answer
81 views

I’m working on merging configuration dictionaries while building a small script. I expected dict.update() to merge nested dictionaries, but it seems to completely overwrite them instead. base = { &...
Linda's user avatar
  • 37
6 votes
2 answers
168 views

What is the difference between Map::entry and AbstractMap.SimpleImmutableEntry::new? I tried to do research, and I really couldn't find much. It seems like Map::entry is a factory method, while ...
Dr. Lul's user avatar
  • 63

15 30 50 per page
1
2 3 4 5
5751