<commit_before>'''
Created on Jul 2, 2014

@author: viejoemer

How to create a dictionary in Python?

¿Cómo crear un diccionario en Python?

A dictionary is mutable and is another container type that can 
store any number of Python objects, including other container 
types.
'''

#dict empty {}
d = {}
print(d)

#dict empty with the method dict()
d = dict()
print(d)

#dict with values using the method dict()
d = dict(one=1, two=2, three=3)
print(d)

#dict with values using {}
d = {"one":1, "two":2, "three":3}
print(d)

#dict with zip and dict methods
d = dict(zip(['one', 'two', 'three'], [1, 2, 3]))
print(d)

#creating a dict using list and tuples
d = dict([('two', 2), ('one', 1), ('three', 3)])
print(d)

#Creating a dict using {} and method dict()
d = dict({'three': 3, 'one': 1, 'two': 2})
print(d)


<commit_msg>HowTo create a dictionary in Python?<commit_after>'''
Created on Jul 2, 2014

@author: viejoemer

HowTo create a dictionary in Python?

¿Cómo crear un diccionario en Python?

A dictionary is mutable and is another container type that can 
store any number of Python objects, including other container 
types.
'''

#dict empty {}
d = {}
print(d)

#dict empty with the method dict()
d = dict()
print(d)

#dict with values using the method dict()
d = dict(one=1, two=2, three=3)
print(d)

#dict with values using {}
d = {"one":1, "two":2, "three":3}
print(d)

#dict with zip and dict methods
d = dict(zip(['one', 'two', 'three'], [1, 2, 3]))
print(d)

#creating a dict using list and tuples
d = dict([('two', 2), ('one', 1), ('three', 3)])
print(d)

#Creating a dict using {} and method dict()
d = dict({'three': 3, 'one': 1, 'two': 2})
print(d)



{'fraction_non_alphanumeric': 0.16366906474820145, 'fraction_numerical': 0.023980815347721823, 'mean_word_length': 4.54485049833887, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2075430', 'n_tokens_mistral': 628, 'n_tokens_neox': 592, 'n_words': 244}