Top "Dictionary" questions

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

How to filter a dictionary according to an arbitrary condition function?

I have a dictionary of points, say: >>> points={'a':(3,4), 'b':(1,2), 'c':(5,5), 'd':(3,3)} I want to create a …

python dictionary filter
Accessing dict keys like an attribute?

I find it more convenient to access dict keys as obj.foo instead of obj['foo'], so I wrote this …

python dictionary syntax attributes
Is there any advantage of using map over unordered_map in case of trivial keys?

A recent talk about unordered_map in C++ made me realize that I should use unordered_map for most cases …

c++ performance dictionary unordered-map
Iterating Through a Dictionary in Swift

I am a little confused on the answer that Xcode is giving me to this experiment in the Swift Programming …

dictionary swift
Swift: declare an empty dictionary

I am beginning to learn swift by following the iBook-The Swift Programming Language on Swift provided by Apple. The book …

ios swift dictionary
Looping through a hash, or using an array in PowerShell

I'm using this (simplified) chunk of code to extract a set of tables from SQL Server with BCP. $OutputDirectory = "c:\…

powershell dictionary hashtable
How to pass dictionary items as function arguments in python?

My code 1st file: data = {'school':'DAV', 'standard': '7', 'name': 'abc', 'city': 'delhi'} my_function(*data) 2nd file: my_…

python function python-2.7 dictionary
Dictionaries and default values

Assuming connectionDetails is a Python dictionary, what's the best, most elegant, most "pythonic" way of refactoring code like this? if "…

python dictionary coding-style
python: Appending a dictionary to a list - I see a pointer like behavior

I tried the following in the python interpreter: >>> >>> a = [] >>> b = {1:'one'} &…

python list dictionary
C# Convert List<string> to Dictionary<string, string>

This may seem an odd thing to want to do but ignoring that, is there a nice concise way of …

c# list dictionary