<jupyter_start><jupyter_text>At the start of this video  1. We were able to use in-built Python data types.  2. We implemented lambda expressions in Python.  List Comprehension<jupyter_code>my_list = [1, 2, 3, 4, 5]
my_new_list = [ elem * 10 for elem in my_list]
my_new_list<jupyter_output><empty_output><jupyter_text>Dictionary Comprehension<jupyter_code>my_sqr_dict = { elem : elem * elem for elem in my_list}
my_sqr_dict
my_str_list = ["hello" , "world", "yolo", "bye"]
my_len_dict = { elem: len(elem) for elem in my_str_list}
my_len_dict<jupyter_output><empty_output><jupyter_text>Time Comparision<jupyter_code>import time
start = time.time()
new_list = []
for x in range(0, 90000000):
    new_list.append(x*2)
end = time.time()
print("Time take is {} seconds".format(end-start))<jupyter_output>Time take is 10.115634679794312 seconds<jupyter_text>Using List comprehension<jupyter_code>start = time.time()
new_list = [ elem * 2 for elem in range(0, 90000000)]
end = time.time()
print("Time take is {} seconds".format(end-start))<jupyter_output>Time take is 5.4990105628967285 seconds
{'fraction_non_alphanumeric': 0.11683532658693652, 'fraction_numerical': 0.05795768169273229, 'mean_word_length': 6.351351351351352, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '454499', 'license': 'MIT', 'n_tokens_mistral': 449, 'n_tokens_neox': 403, 'n_words': 102, 'path': 'Section 1/notebooks/1. 4 Comprehensions for Speedup.ipynb', 'repo_name': 'PacktPublishing/High-Performance-Computing-with-Python-3.x', 'size': '1087'}