Top "Dictionary" questions

A dictionary maps keys to values allowing efficient retrieval of values by keys.

Extract subset of key-value pairs from Python dictionary object?

I have a big dictionary object that has several key value pairs (about 16), but I am only interested in 3 of …

python dictionary associative-array
Loop through Map in Groovy?

I have a very simple task I am trying to do in Groovy but cannot seem to get it to …

dictionary groovy
Using python map and other functional tools

This is quite n00bish, but I'm trying to learn/understand functional programming in python. The following code: foos = [1.0,2.0,3.0,4.0,5.0] bars = [1,2,3] …

python dictionary functional-programming
Getting a list of values from a list of dicts

I have a list of dicts like this: [{'value': 'apple', 'blah': 2}, {'value': 'banana', 'blah': 3} , {'value': 'cars', 'blah': 4}] I want ['apple', …

python list dictionary
Convert dictionary to list collection in C#

I have a problem when trying to convert a dictionary to list. Example if I have a dictionary with template …

c# list dictionary
Initializing a dictionary in python with a key value and no corresponding values

I was wondering if there was a way to initialize a dictionary in python with keys but no corresponding values …

python dictionary initialization key
How can I get a collection of keys in a JavaScript dictionary?

I have a dictionary: var driversCounter = { "one": 1, "two": 2, "three": 3, "four": 4, "five": 5 } Now, I need to show it in a dropdownlist. …

javascript dictionary
python tuple to dict

For the tuple, t = ((1, 'a'),(2, 'b')) dict(t) returns {1: 'a', 2: 'b'} Is there a good way to get {'a': 1, 'b': 2} (…

python dictionary tuples
How to convert an xml string to a dictionary?

I have a program that reads an xml document from a socket. I have the xml document stored in a …

python xml json dictionary xml-deserialization
How can I print out C++ map values?

I have a map like this: map<string, pair<string,string> > myMap; And I've inserted some …

c++ dictionary for-loop printing std-pair