Skip to main content
Filter by
Sorted by
Tagged with
-4 votes
2 answers
89 views

By This I mean if the first dictionary is this: Names = { Dicta : { "Name" : "John", "DOB" : 12122025, }, } The second dictionary is this: Dictb = { &...
alevanpa1's user avatar
-2 votes
2 answers
123 views

I think the easiest way to show this is the following... I have this: {log_1: [{x:'11/25/2025 7:00 AM', y: '3'},{x:'11/25/2025 7:15 AM', y: '43'},{x:'11/25/2025 7:30 AM', y: '49'}], log_2: [{x:'11/25/...
lukehawk's user avatar
  • 1,543
-3 votes
1 answer
100 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 Neto's user avatar
Advice
0 votes
8 replies
175 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
141 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,890
1 vote
3 answers
154 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
  • 11
-4 votes
0 answers
45 views

I am to update a python dictionary while iterating over it, but some keys are getting skipp data = { "a": 1, "b": 2, "c": 3, "d": 4 } for key ...
K.Venkata Ramanna's user avatar
Advice
2 votes
6 replies
84 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,117
4 votes
3 answers
215 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
-3 votes
1 answer
191 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
217 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
  • 1,999
1 vote
3 answers
90 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
92 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
142 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
33 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
1 vote
1 answer
168 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
61 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
156 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
95 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
183 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
1 vote
1 answer
162 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
  • 93
1 vote
1 answer
202 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
130 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 ...
Second Hand's user avatar
-1 votes
1 answer
91 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
121 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
57 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
176 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
66 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
175 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
128 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 vote
1 answer
146 views

I'm creating a lookup table / dictionary from a static spreadsheet for upcoming labelling on input data, adding a new field for flavor: lookup_table_data = pd.read_csv(r'C:\Location\format1.csv', sep='...
Chester's user avatar
  • 23
0 votes
1 answer
105 views

I am attempting to build and populate a data structure consisting of multiple, but variable count, nested dictionaries in C#. I am currently using a recursive function to do so. The data stored in the ...
buca117's user avatar
  • 21
0 votes
0 answers
65 views

Hi I'm trying to modify the .NET runtime from github.com/dotnet/runtime. I downloaded the release from that github repository website. Then, you extract the files to C:\rt. Then run .\build.cmd -s clr+...
Erik343's user avatar
  • 343
14 votes
3 answers
1k views

Assumption is that we have a dictionary containing exactly one key/value pair. Objective is to extract the only key. I can think of four ways to do this (there may be more). import timeit def func1(d):...
jackal's user avatar
  • 29.1k
2 votes
1 answer
56 views

I've been doing a lot of HackerRank challenges lately and many of them are in the form of "read instructions from input() and perform the instruction on an object." For example, with a list ...
gglazer's user avatar
  • 47
0 votes
2 answers
189 views

I am struggling to get Qt/QML to use downloaded tiles from local drive. The map is always generated with online tiles and not my local files. I looked at many other posts but none of them worked for ...
Marco's user avatar
  • 1
0 votes
2 answers
188 views

I'm trying to convert a List of Products to a Map<Long, String> using Java streams. My goal is to collect the DTOs into a map where the key is getId() and the value is getLogoPath(). The ...
Preet Bista's user avatar
0 votes
2 answers
80 views

Hoping that everyone is having a good one. (This is a continuation of another question I asked which can be found here: Does Excel VBA's "Scripting.Dictionary" work in languages other ...
Anpo Desu's user avatar
  • 396
2 votes
2 answers
130 views

everyone. I appreciate the people that helped me a few days back. I can say that there has been a bit of progress, but it's pretty much not done yet. I'm trying to compare the Primary Store (Column C) ...
Anpo Desu's user avatar
  • 396
-1 votes
1 answer
51 views

So zip_geo is a tigris object that has a variable at the zip code level I'd like to plot. I do it this way: wind_map <- ggplot()+ geom_sf(data=shift_geometry(zip_geo), aes(fill=wind_group), ...
leviemb's user avatar
  • 87
0 votes
2 answers
156 views

I have var foundItems = new Dictionary<string, List<string>>(); string[] targetColumns; string value; Adding a value to a key works fine with this code: foundItems[targetColumns[i]].Add(...
wesley delk's user avatar
1 vote
1 answer
105 views

I have the question same with link Pydantic does not validate the key/values of dict fields from typing import Dict from pydantic import BaseModel class TableModel(BaseModel): table: Dict[str, ...
nelson_metaheuristic's user avatar
4 votes
1 answer
203 views

I have a really simple benchmark to measure and compare performance of Dictionary<string, int> and ConcurrentDictionary<string, int>: [MemoryDiagnoser] public class ...
Pupkin's user avatar
  • 1,223
1 vote
0 answers
49 views

I'm trying to create a map of the US at the zip code level to show the value of a particular variable. Used this code to create the source: zcta_geo <- tigris::zctas(class = "sf", year=...
leviemb's user avatar
  • 87
0 votes
2 answers
118 views

I am initializing a fairly large dictionary in C#. I have benchmarked the speed of building the dictionary with the capacity and without. It is (as expected) significantly faster (and uses ...
FluidMechanics Potential Flows's user avatar
4 votes
3 answers
132 views

I have a pandas dataframe of the following structure: d = {'I': ['A', 'B', 'C', 'D'], 'X': [ 1, 0, 3, 1], 'Y': [0, 1, 2, 1], 'Z': [1, 0, 0, 0], 'W': [3, 2, 0, 0]} df = pd.DataFrame(data=d, columns=['I'...
carpediem's user avatar
  • 491
0 votes
2 answers
80 views

I have a map which lays down prices of commodities in different currencies val commpricemap: Map[String , Map[String, Double]] = ??? AN example of an entry for gold is as below: ("AU" -> ...
IUnknown's user avatar
  • 10k
2 votes
1 answer
285 views

I recently had to update the virtual environment for one of my libraries from Python 3.7 to 3.10, which also involved updating Pandas from 1.1.5 to 2.3.0. In the previous virtual environment, this ...
Jan Stuller's user avatar
0 votes
0 answers
45 views

I am creating a swiftui map view with code below, I can see the blue dot for user location, but I can not see the user heading annotation (the blue fan out partially transparent image connected to the ...
Alan shen's user avatar
2 votes
2 answers
86 views

I'm sorting grades by number ranges and adding them to my dictionary keys. For some reason my code is ignoring value 68 altogether. My code: import numpy as np exam_results = np.array( [ ...
RicardoDLM's user avatar

1
2 3 4 5
1726