Top "Dictionary" questions

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

How to retrieve all keys (or values) from a std::map and put them into a vector?

This is one of the possible ways I come out: struct RetrieveKey { template <typename T> typename T::first_…

c++ dictionary stl stdmap
Check if a given key already exists in a dictionary and increment it

Given a dictionary, how can I find out if a given key in that dictionary has already been set to …

python dictionary
Filter dict to contain only certain keys?

I've got a dict that has a whole bunch of entries. I'm only interested in a select few of them. …

python dictionary
Python Dictionary Comprehension

Is it possible to create a dictionary comprehension in Python (for the keys)? Without list comprehensions, you can use something …

python dictionary list-comprehension
How do you create nested dict in Python?

I have 2 CSV files: 'Data' and 'Mapping': 'Mapping' file has 4 columns: Device_Name, GDN, Device_Type, and Device_OS. All …

python python-2.7 dictionary mapping nested
Java - How to create new Entry (key, value)

I'd like to create new item that similarly to Util.Map.Entry that will contain the structure key, value. The …

java dictionary collections key-value
Convert a JSON String to a HashMap

I'm using Java, and I have a String which is JSON: { "name" : "abc" , "email id " : ["[email protected]","def@gmail.…

java json dictionary
What is the preferred syntax for initializing a dict: curly brace literals {} or the dict() function?

I'm putting in some effort to learn Python, and I am paying close attention to common coding standards. This may …

python dictionary
how to concatenate two dictionaries to create a new one in Python?

Say I have three dicts d1={1:2,3:4} d2={5:6,7:9} d3={10:8,13:22} How do I create a new d4 that combines these three dictionaries? …

python dictionary concatenation
How to keep keys/values in same order as declared?

I have a dictionary that I declared in a particular order and want to keep it in that order all …

python sorting dictionary