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.

dictionary
-1 votes
1 answer
23 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
38 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
28 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
30 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
33 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
42 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
84 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
49 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
12 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
22 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
94 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
11 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
-7 votes
0 answers
47 views

Adding items in python dictionary [closed]

student_scores = { "Harry": 81, "Ron": 78, "Hermione": 99, "Draco": 74, "Neville": 62, } student_grades = {} for student in ...
Haha Lol's user avatar
-8 votes
0 answers
45 views

Python. How to parse indented text to dicts?

I have this text from the log. How to convert it to a dictionary? The ultimate goal is that ITEMs that contain a date do not need to be converted (item[3,4]). CodAnsw = 12 IdentAnsw = 1 Data: ...
Andy_bat's user avatar
1 vote
2 answers
54 views

Pandas Map Dictionary with Multiple Values to Dataframe

I have the following dataframe: data = [['BALANCED', 'Corp EUR'], ['YIELD', 'Corp USD'], ['GROWTH', 'HG CHF']] df = pd.DataFrame(data, columns=['STRATEGY', 'ASSET_CLASS'] df STRATEGY ...
Ben's user avatar
  • 173

15 30 50 per page
1
2 3 4 5
7