Skip to main content
Filter by
Sorted by
Tagged with
-2 votes
1 answer
107 views

I have some json that looks like this: "lines": { "0010": { "ProvCountyCode": "047", "ProvNo": "770887", "...
Mark Ainsworth's user avatar
5 votes
1 answer
149 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
38 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
  • 43
Advice
2 votes
5 replies
82 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
61 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
112 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
0 votes
0 answers
124 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
1 vote
1 answer
60 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
88 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
71 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
94 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
239 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
120 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
83 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
170 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
-1 votes
1 answer
102 views

I'm working on a project that involves generating random data according to a wide variety of specific distributions. The number of sample points to generate can go up to hundreds of thousands, ...
Blackyu Sylvean's user avatar
Best practices
0 votes
2 replies
53 views

I'm writing a program to find substitution ciphers of a test_phrase that themselves are valid English phrases. Example: test_phrase = 'x marks the spot' → ['a whole sky ends', 'I stage our echo', ...] ...
WeCanDoItGuys's user avatar
0 votes
1 answer
35 views

I'm trying to create a custom state function that needs to access nested dictionaries (dictionaries within dictionaries), but I'm encountering type errors when creating the streaming engine. My code ...
Allan's user avatar
  • 21
0 votes
0 answers
29 views

I am embedding the MarineTraffic map using the official <iframe> embed. The embedded map displays a search bar, but the search does not work and always returns “Nothing to sea here”, which ...
TheSabalaja's user avatar
2 votes
0 answers
51 views

I have this map: <l-map ref="mapRef" :use-global-leaflet="false" > and wanted to fit the map based on bounds which calculated in this way: bounds.extend([lat, lng]); ...
Navid's user avatar
  • 943
Advice
1 vote
6 replies
115 views

I have made a dictionary and a list of dictionaries, but I am not sure how to get specific data from the different forms. I tried using '.startswith('7'), but it always gives me an error. I want to ...
Gabriella Dines's user avatar
2 votes
1 answer
116 views

I need to create list from CSV file (it data is movies information like title, director, and actors. Directors and actors are list while other data is just string) it look like this: with open('filmy....
Michasx's user avatar
  • 33
-3 votes
1 answer
165 views

I need to aggregate all the timestamped values into their sums. (Please note data may be missing for a specific log at specific timestamp.) I have this: const logs = { log_1: [ { x: "...
lukehawk's user avatar
  • 1,541
-3 votes
1 answer
118 views

I can update a deepcopy of a dictionary in two steps. But when I try to make it a single step it returns None. from copy import deepcopy d0 = {'a': 1} d1 = deepcopy(d0) d1.update([('b', 2)]) print(d0,...
Clodoaldo Pinto's user avatar
Advice
0 votes
8 replies
200 views

Let's say I have a dictionary such as: dict = { "Mars": [4, 3, 4, 7, 10], "Jupiter": [6, 6, 7, 9, 11], "Saturn": [4, 5, 12, 22, 1]} I would like to iterate through each ...
triedandtested's user avatar
0 votes
1 answer
155 views

I am trying to create a map of stringstreams in C++ std::map<int, std::stringstream> myMap; std::stringstream ss; myMap.insert(std::pair<int, std::stringstream>(1, ss)); This fails to ...
craig1231's user avatar
  • 3,918
1 vote
3 answers
236 views

I have a populated dictionary Test with two keys in TestKeys and five values in TestValues all created via structure objects: Structure TestKeys Public Key1 As String Public Key2 ...
sp64's user avatar
  • 27
Advice
2 votes
6 replies
113 views

Referring to the attached diagram for an example hierarchy of materials, how can I represent this in F#? Once represented I need to be able to add ANY/ALL of the materials in level 4 (L4) of the ...
Dib's user avatar
  • 2,137
4 votes
3 answers
232 views

I am trying to count word frequencies in a text and then sort them in descending order of frequency. So if two words have the same frequency, they should remain in the same order they first appeared ...
Rishabh Kumar's user avatar
-4 votes
1 answer
214 views

I have to create a dictionary, where the keys are letters of the alphabet, and the values are the indexed letters of a given string. Example: Given the string "BDFHJLCPRTXVZNYEIWGAKMUSQO" ...
Shadow0013's user avatar
2 votes
1 answer
232 views

I have 2 maps using BidBook = std::map<float, int, std::greater<>>; // price -> qty using AskBook = std::map<float, int, std::less<>>; I have a struct that contain iterator ...
Huy Le's user avatar
  • 2,009
1 vote
3 answers
91 views

This is my simple code for noting down dreams from Python crash course practices 10.7 In this practice I tried to make a list of dreams instead of simply adding a value to key but don't how to make a ...
Nicolas_Darksoul's user avatar
0 votes
1 answer
100 views

I am trying to use std::map to map numerical IDs to function handlers: All function handlers take two integers and return an integer. Handler 100 would calculate the product. When preparing the map, ...
Ralf's user avatar
  • 11
Advice
0 votes
9 replies
145 views

In python 3.12 I have a dictionary of which the keys are 2-tuples of integers and of which the values are integers (as in the function f:N × N → N for which f(n, m) = n + m). What I need is those keys ...
PaulTanenbaum's user avatar
Advice
1 vote
1 replies
36 views

I need to transfer a MBTiles map tiles from a disk to another, is there a faster way then just mv? It is huge and takes time.
Alperen Ölçer's user avatar
0 votes
1 answer
172 views

I have a JSON file with nested objects, and I want to update specific values inside it using Python. The structure can vary, but it usually looks something like this: { "user": { "...
JEFFERSON FRANCISCO ABAC LEMUS's user avatar
-1 votes
2 answers
74 views

I couldn't figure out the way to process nested leafs/branches/parents, not sure what the actual best terminology is. I've got the reading of the data happening correctly, far as i can tell. Its in ...
Mike Collins's user avatar
2 votes
2 answers
165 views

I need help with a repetitive task that I use vlookup for huge dataset, a bunch of tables of >1 million rows from multiple columns, multiple sheets of another workbook. ID TA ISRC Result ID1 TA1 ...
Hoang Nguyen Dinh's user avatar
2 votes
1 answer
123 views

I have a dictionary object, very simple: const mydict = { key1: "value1", key2: "value2" } how do I make a type that automatically converts an object like this into entries? ...
L1Q's user avatar
  • 37
2 votes
2 answers
200 views

I’m trying to draw a SpatRaster on a dynamic map using terra::plet() and a standard palette. The example code used to work in older terra versions (the raster showed a proper yellow/orange gradient), ...
Ignacio Marzan's user avatar
0 votes
1 answer
232 views

I'm currently following this Python course course from Harvard. At the point in the video, the instructor shows that the following code should raise a SyntaxError because of the conflicting double ...
Matteo's user avatar
  • 69
1 vote
1 answer
211 views

I am trying to write C++ code to implement a cache. The cache uses Least Recently Used policy explained by the behaviour: If the cache has a capacity to store 5 keys like 5 3 2 1 4 then if next key=1 ...
Arif Mahmood's user avatar
0 votes
1 answer
138 views

I want to know the difference between entrySet and sequencedEntrySet methods in LinkedHashMap in Java 21+. I am not sure why we have sequencedEntrySet since LinkedHashMap guarantees the insertion ...
Strait of Hormuz's user avatar
-1 votes
1 answer
96 views

I was brushing up on Array for an implementation and I stumbled on this discovery, I expected the following code to give me an array filled with the number 42: Array(3).map(x => 42) But instead, ...
UncleBigBay's user avatar
0 votes
1 answer
126 views

I have a json file to store the data for an app. This json file has this dict in it: { "Survival": { "text": "Survival", "directory": "...
Cube Rubik's user avatar
0 votes
0 answers
81 views

I have a .NET MAUI solution with multiple projects sharing a common library ( General). Maps were working fine previously, but now they're not loading properly in my offline project, Problem Details ...
Yash's user avatar
  • 1
0 votes
2 answers
213 views

I have a CSV file keeping track of people's score in a game. I read it with csv.DictReader(). How do I create a dictionary with the keys being the names and the value being the scores? CSV file ...
user31290254's user avatar
-4 votes
1 answer
69 views

I am working on a project and trying to convert a csv into JSON Dictionary and saving that JSON data file to S3 bucket via S3FileSystem. If I save this JSON DIctionary to local machine, formate is ...
Python Learner's user avatar
-5 votes
1 answer
184 views

I want to create an object in Java, converting code from JavaScript, but I cannot find how to do so. It's a really simple problem in JavaScript: MINI_KEYS = ["1", "2", "3"...
Rewind's user avatar
  • 2,860
0 votes
2 answers
132 views

I have a dictionary with lists of datetime as value: month_a = [8,9,10] day_a = [13,12,15] month_b = [8,9,10] day_b = [13,11,13] dt_a=[] for m,d in zip(month_a, day_a): dt_a.append(datetime....
Wenjie Yu's user avatar
  • 101

1
2 3 4 5
1726