Skip to main content
Filter by
Sorted by
Tagged with
-2 votes
1 answer
171 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
1 vote
3 answers
84 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
Advice
0 votes
9 replies
137 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
1 vote
1 answer
150 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
2 votes
2 answers
153 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
2 answers
173 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
197 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
-1 votes
1 answer
87 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
0 answers
50 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
-4 votes
1 answer
61 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
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
0 votes
1 answer
104 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
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
0 votes
2 answers
159 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
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
-1 votes
1 answer
42 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
1 vote
1 answer
92 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
1 vote
0 answers
47 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
4 votes
3 answers
128 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
  • 481
2 votes
1 answer
282 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
2 votes
2 answers
85 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 vote
1 answer
100 views

Because plain dict is not adequate for inheritance, I design the following MyDict with UserDict in python standard libraries: import numpy as np from collections import UserDict class MyUserDict(...
DrizzleatDusk's user avatar
2 votes
1 answer
55 views

I'm trying to implement the following functionality in DolphinDB: Create a dictionary with city names as keys and population counts as values Find cities with population over 10 million Sort cities by ...
Elsa's user avatar
  • 21
0 votes
2 answers
44 views

I was trying to figure out how to add an "s" to items that didn't end in "s" in a dictionary before printing the item to the console. I figured out a way to do it, but it seems ...
TechnoM4ncer's user avatar
1 vote
0 answers
41 views

I am testing the existence of local variables LatLim and LongLim at the Spyder console: >>> LatLim = (36.033333,36.2333) >>> LongLim = (-5.5333,-5.25) >>> locals().keys() ...
user2153235's user avatar
  • 1,265

1
2 3 4 5
1726