Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [dictionary]

A dictionary maps keys to values allowing efficient retrieval of values by keys. Use the [map-function] tag for mapping functions; use the [maps] tag for geography.

-2 votes
2 answers
61 views

How can I add values in different dictionaries with same keys together? [duplicate]

Let's say I have three different dictionaries: dictA = {'A': 1, 'B': 2, 'C': 3} dictB = {'C': 1, 'D': 2, 'E': 3} dictC = {'A': 2, 'C': 4, 'E': 6, 'G': 8} And I want to "add" these ...
mrelpa's user avatar
  • 11
0 votes
0 answers
4 views

have mui icons in a dictonary using map to go through a dict and use the mui icons

When I try to use the dictionary from the JavaScript file and apply the map function to the categories, I encounter an error: SyntaxError: Unexpected token '<' on the first line of the dictionary. ...
Ace's user avatar
  • 1
-1 votes
2 answers
62 views

Changing Data type input from MySQL in FastAPI

enter code hereI have "serialize_response" error for this line : @app.get("/get-sensors/", response_model=List[Data]) and this : return {"status": "success", &...
Amirmohammad Alian nezhad's user avatar
-1 votes
1 answer
28 views

TypeError: 'NoneType' object is not subscriptable while fetching information for rejected reason from jira [duplicate]

for issue in issues: fields = issue['fields'] results.append({ 'key': issue['key'], 'summary': fields['summary'], 'description': fields['description'], '...
anurag's user avatar
  • 9
1 vote
2 answers
41 views

Python nested dictionary to Tree

I am trying to display my nested dictionary as a Tree. data = {"L1" : {"sub L1" : "sub sub L1"}, "L2" : "...
Kruti Deepan Panda's user avatar
-1 votes
0 answers
31 views

Non destructive dictionary update in python [duplicate]

Is there a library function that implements a non-destructive dictionary update like def update(d,key,val) : d=d.copy() d[key]=val return d
Thorsten Altenkirch's user avatar
0 votes
0 answers
34 views

Issue with tkinter (pyimage10) [closed]

This call back error. Im trying to call a menu from a separate script using a fuction. It seems like garbage collector is messing with the menu images. Ive tried moving my images into a dictionary and ...
Jack snellings's user avatar
0 votes
1 answer
40 views

Using a str variable as a key for a map always returns null

I am trying to use a Map without success. I have whittled it down to a bare-bones case: I create a Map with four entries: ("fruit", 25) ("veg", 30) ("baked", 35) ("...
tbbrightman's user avatar
-1 votes
2 answers
46 views

Take a Python dictionary with values as lists and create a new list of dictionaries each with the initial key and list values

If I have a dictionary with list values: users = {'first-name': ['Jim', 'John', 'Jane'], 'last-name': ['Boothe', 'Smith', 'Doe'], 'user': ['100', '101', '102']} How can I create a new list of ...
Jim Boothe's user avatar
0 votes
1 answer
90 views

Finding the longest Dictionary.Key match in a phrase

I have a SortedDictionary<string, string>, ordered by key length descending, of the form: red fox - address1 weasel - address2 foxes - address3 fox - address3 etc. and a list of phrases e.g. &...
alexb's user avatar
  • 33
1 vote
1 answer
50 views

Update values in a dictionary based on changes made to another dictionary

I would like to know if there is a way to automatically update the value in a dictionary based on changes made to values in another dictionary. I have 2 dictionaries as follows: enum ...
Bob's user avatar
  • 192
0 votes
0 answers
13 views

json.dump() adding backslash when double quotes are added in python dictionary

I'm reading data from excel have say proxid as field which contains Multi-values ie. proxid --> ABC-123,PQR-456 (data seperated from comma) My task is to read the data and convert this data in ...
Jinesh's user avatar
  • 11
0 votes
0 answers
23 views

Swift convert nested dictionary to protobuf

I am new to Protobuf. Is possible to convert nested dictionary in swift of type [String: Any?] with swift protobuf? How should I define it in a proto file?
bunbun's user avatar
  • 9
4 votes
3 answers
99 views

Partial exists in dictionary

I m looking for a way to check if a value included in a dictionary, Excel - VBA. However, simple dict.Exists("") is not the right approach in this situation because the searching value with ...
Error 1004's user avatar
  • 8,158
-1 votes
0 answers
12 views

why my whole dictionary 1 values change when get a new value [duplicate]

I wrote a code to catch values in a dictionary as another dictionary value but when I run the code second values over write on pervious value. I wrote this code: dict1={} dict2={} for i in ['A','B']: ...
mohammad reza Zardoshti's user avatar

15 30 50 per page
1
2 3 4 5
5749