<jupyter_start><jupyter_text>Python For Data Science - Dict- mostly used in data science- store data values in key:value pairs- dictionary is a collection which is unordered, changeable and does not allow duplicates- Dictionaries are written with curly brackets, and have keys and values:<jupyter_code># create Dict

d = {}
print(type(d))

d = dict()
print(type(d))
d = {1 : "summing" , 2 : "up"}
print(d)
d = {1 : "just","task" : "practice" , 2:"python"}
print(d)
#pass key & value as tuple
d = dict([(1,"summing"),(2,"up")])
print(d)
d = {"name": "summing_up" , "whats for": "to help people"}
print(d)
print(d['name'])
print(d['whats for'])
# change value
d['name'] = "summing up ai"
print(d)
# remove 
d.pop('whats for')
print(d)
d = {}.fromkeys(["hey","there"],1)
print(d)
# some dict methods

d = {1:"one",2:"two",3:"three",4:"four"}

print("keys : " , d.keys())

print('values : ' , d.values())

print("items : ", d.items())

d1 = {5:"five",6 :"six"}



d.update(d1)
print("update :" ,d)
# all methods
print(dir(dict()))
# print(all key value pair)
for items in d.items():
    print(items)
# dict Comprehension
a = [items for items in d.items()]
print(a)<jupyter_output>[(1, 'one'), (2, 'two'), (3, 'three'), (4, 'four'), (5, 'five'), (6, 'six')]
{'fraction_non_alphanumeric': 0.21645367412140576, 'fraction_numerical': 0.016773162939297124, 'mean_word_length': 5.08252427184466, 'pattern_counts': {'":': 2, '<': 4, '<?xml version=': 0, '>': 4, '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}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '592839', 'license': 'MIT', 'n_tokens_mistral': 497, 'n_tokens_neox': 481, 'n_words': 142, 'path': 'Python_For_Data_Science_Dict.ipynb', 'repo_name': 'Jitendra-Dash/Python-For-Data-Science', 'size': '1252'}