title
Python - Accessing Nested Dictionary Keys

description
Working with .json data is a very common task, no matter if you’re coming from the data science or the web development world. Let’s get started with the .json encoder in this video and see how we can access, modify and save .json data in Python. ---------- Learn Python from scratch: https://acad.link/python-blockchain Download the source file: https://a.storyblok.com/f/42126/x/ffd1540217/source-data.json What is a Dictionary: https://docs.python.org/3/tutorial/datastructures.html#dictionaries What are Lists: https://docs.python.org/3/tutorial/introduction.html#lists Want to learn something totally different? Check out all other courses: https://academind.com/learn/our-courses ---------- • You can follow Max on Twitter (@maxedapps). • And you should of course also follow @academind_real. • You can also find us on Facebook.(https://www.facebook.com/academindchannel/) • Or visit our Website (https://www.academind.com) and subscribe to our newsletter! See you in the videos! ---------- Academind is your source for online education in the areas of web development, frontend web development, backend web development, programming, coding and data science! No matter if you are looking for a tutorial, a course, a crash course, an introduction, an online tutorial or any related video, we try our best to offer you the content you are looking for. Our topics include Angular, React, Vue, Html, CSS, JavaScript, TypeScript, Redux, Nuxt.js, RxJs, Bootstrap, Laravel, Node.js, Progressive Web Apps (PWA), Ionic, React Native, Regular Expressions (RegEx), Stencil, Power BI, Amazon Web Services (AWS), Firebase or other topics, make sure to have a look at this channel or at academind.com to find the learning resource of your choice!

detail
{'title': 'Python - Accessing Nested Dictionary Keys', 'heatmap': [{'end': 462.756, 'start': 413.54, 'weight': 1}, {'end': 657.869, 'start': 636.199, 'weight': 0.708}], 'summary': 'Tutorial series on python covers various topics such as accessing and manipulating nested data, retrieving information from nested dictionaries and lists, file handling, and processing and saving json data using python. it includes practical examples like accessing json data and extracting user names from questions.', 'chapters': [{'end': 609.312, 'segs': [{'end': 47.787, 'src': 'embed', 'start': 2.335, 'weight': 0, 'content': [{'end': 3.736, 'text': 'Welcome to another Python video.', 'start': 2.335, 'duration': 1.401}, {'end': 10.24, 'text': "In this video, we'll have a look at how we can access information in nested dictionaries.", 'start': 4.256, 'duration': 5.984}, {'end': 12.681, 'text': 'For that, we need nested data.', 'start': 10.62, 'duration': 2.061}, {'end': 15.643, 'text': 'And this is the data we will use for that purpose.', 'start': 13.181, 'duration': 2.462}, {'end': 18.444, 'text': 'As you can see, this is data in JSON format.', 'start': 16.103, 'duration': 2.341}, {'end': 24.149, 'text': "So we'll also learn how we can access information stored in the JSON format in Python.", 'start': 18.604, 'duration': 5.545}, {'end': 32.875, 'text': 'And the data is extracted from the Q&A section of our Angular 7 course on Udemy because students can ask questions and normally they will get answers.', 'start': 24.709, 'duration': 8.166}, {'end': 42.503, 'text': 'For that, we have some results right here because we retrieved this data from an API and we can see that we have a question right here.', 'start': 33.476, 'duration': 9.027}, {'end': 47.787, 'text': 'This one from the Angular course, as I said, and we also got replies.', 'start': 43.524, 'duration': 4.263}], 'summary': 'Access information in nested dictionaries and json format from q&a section of angular 7 course on udemy.', 'duration': 45.452, 'max_score': 2.335, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/oQfNYqz8pLs/pics/oQfNYqz8pLs2335.jpg'}, {'end': 176.437, 'src': 'embed', 'start': 153.959, 'weight': 2, 'content': [{'end': 162.504, 'text': 'If you now hit shift and enter, well, you can get started because now we can use the functionality of this JSON encoder to, well, open this JSON file.', 'start': 153.959, 'duration': 8.545}, {'end': 164.666, 'text': 'For that, we simply type with.', 'start': 162.905, 'duration': 1.761}, {'end': 168.07, 'text': 'open like that.', 'start': 166.408, 'duration': 1.662}, {'end': 176.437, 'text': 'And now we open brackets and add single quotation marks because now we have to specify either the file name of the file that you want to open.', 'start': 168.65, 'duration': 7.787}], 'summary': 'Using shift and enter to open json file with open function.', 'duration': 22.478, 'max_score': 153.959, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/oQfNYqz8pLs/pics/oQfNYqz8pLs153959.jpg'}, {'end': 306.502, 'src': 'embed', 'start': 273.972, 'weight': 3, 'content': [{'end': 275.234, 'text': 'into a Python object.', 'start': 273.972, 'duration': 1.262}, {'end': 276.976, 'text': "We'll have a closer look at that in a few seconds.", 'start': 275.374, 'duration': 1.602}, {'end': 279.598, 'text': 'And by that, make it readable for Python.', 'start': 277.296, 'duration': 2.302}, {'end': 282.421, 'text': 'And this also allows us to access the content in the end.', 'start': 279.919, 'duration': 2.502}, {'end': 288.208, 'text': 'Now with JSON load, we simply have to add in brackets the name that we defined right here.', 'start': 283.102, 'duration': 5.106}, {'end': 289.789, 'text': 'So access JSON.', 'start': 288.388, 'duration': 1.401}, {'end': 294.118, 'text': 'Access json like that.', 'start': 290.61, 'duration': 3.508}, {'end': 297.679, 'text': 'if we now hit shift and enter, you can see well, nothing basically,', 'start': 294.118, 'duration': 3.561}, {'end': 306.502, 'text': 'but entering the name of our variable right here and hitting shift and enter basically shows us the content of our json file now,', 'start': 297.679, 'duration': 8.823}], 'summary': 'Using json load in python to access and display the content of a json file.', 'duration': 32.53, 'max_score': 273.972, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/oQfNYqz8pLs/pics/oQfNYqz8pLs273972.jpg'}, {'end': 399.756, 'src': 'embed', 'start': 372.947, 'weight': 4, 'content': [{'end': 379.929, 'text': 'So to summarize that, we have the results key right here in our dictionary and the value which contains this list.', 'start': 372.947, 'duration': 6.982}, {'end': 383.251, 'text': 'More about lists or how we can access data and lists in a few seconds.', 'start': 380.25, 'duration': 3.001}, {'end': 391.513, 'text': 'Now in Python, if we would refer to this key right here, we would also be able to display the corresponding value of that key.', 'start': 383.931, 'duration': 7.582}, {'end': 399.756, 'text': "And that's exactly what we want, because remember, in the end, my goal is to create a list of all the display name values right here.", 'start': 391.853, 'duration': 7.903}], 'summary': 'Using python dictionaries to access and display list values.', 'duration': 26.809, 'max_score': 372.947, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/oQfNYqz8pLs/pics/oQfNYqz8pLs372947.jpg'}, {'end': 462.756, 'src': 'heatmap', 'start': 413.54, 'weight': 1, 'content': [{'end': 417.424, 'text': 'read content and now enter square brackets,', 'start': 413.54, 'duration': 3.884}, {'end': 424.05, 'text': 'and now we only have to add single quotation marks and refer to the key which contains the values that you want to display.', 'start': 417.424, 'duration': 6.626}, {'end': 426.892, 'text': 'in our case, this is the results key right here.', 'start': 424.05, 'duration': 2.842}, {'end': 438.518, 'text': 'so if we enter results now like this and hit shift and enter, we can see that we now display the entire value that our results key contains.', 'start': 426.892, 'duration': 11.626}, {'end': 448.401, 'text': "Now let's maybe also give this right here a name, maybe question access, because that's what we basically have right here.", 'start': 439.399, 'duration': 9.002}, {'end': 450.142, 'text': 'And hit shift and enter once again.', 'start': 449.001, 'duration': 1.141}, {'end': 462.756, 'text': 'And if we now enter type question access once again, Like this, you can see that the type of our data changed because, as I said previously,', 'start': 450.702, 'duration': 12.054}], 'summary': 'Tutorial demonstrating accessing and displaying data using brackets and quotation marks; changing data type.', 'duration': 49.216, 'max_score': 413.54, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/oQfNYqz8pLs/pics/oQfNYqz8pLs413540.jpg'}, {'end': 625.804, 'src': 'embed', 'start': 594.844, 'weight': 5, 'content': [{'end': 599.246, 'text': 'And now you can also see why this video is about accessing nested dictionaries.', 'start': 594.844, 'duration': 4.402}, {'end': 606.35, 'text': 'Because we basically have a dictionary which contains a list, which contains a dictionary, which again then contains a list, and so on.', 'start': 599.466, 'duration': 6.884}, {'end': 609.312, 'text': "So that's this nesting structure we talk about in this video.", 'start': 606.45, 'duration': 2.862}, {'end': 618.459, 'text': 'Now the thing is that with this logic right here, we can access a single list item, but actually we want to access all our list items right here.', 'start': 610.072, 'duration': 8.387}, {'end': 625.804, 'text': 'Now, if we want to kind of repeat something to get all the results, a for loop might be something useful here.', 'start': 618.959, 'duration': 6.845}], 'summary': 'Video explains how to access nested dictionaries and lists using for loops.', 'duration': 30.96, 'max_score': 594.844, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/oQfNYqz8pLs/pics/oQfNYqz8pLs594844.jpg'}], 'start': 2.335, 'title': 'Accessing nested data in python', 'summary': 'Explains how to access and manipulate nested data in python, including accessing json data and creating a list of names from a q&a thread extracted from an angular 7 course on udemy. it also covers opening and converting json data into python objects and working with nested dictionaries and lists to create a list of all display name values from the json data.', 'chapters': [{'end': 196.083, 'start': 2.335, 'title': 'Accessing nested data in python', 'summary': 'Explains how to access information in nested dictionaries using python, accessing data in json format and manipulating it to create a list of names from a q&a thread, extracted from an angular 7 course on udemy.', 'duration': 193.748, 'highlights': ['The chapter explains how to access information in nested dictionaries using Python Covers the main topic of the chapter, focusing on accessing nested dictionaries in Python.', 'Manipulating data to create a list of names from a Q&A thread extracted from an Angular 7 course on Udemy Details the objective of creating a list of names from a Q&A thread in the Angular 7 course on Udemy, emphasizing practical application.', 'Accessing data in JSON format and using the functionality of JSON encoder to open the JSON file Provides specific steps on accessing data in JSON format and utilizing the JSON encoder to open the file, demonstrating practical implementation.']}, {'end': 609.312, 'start': 196.524, 'title': 'Accessing nested dictionaries in python', 'summary': 'Explains how to open and convert json data into python objects, access information stored in dictionaries, and work with nested dictionaries and lists in python, aiming to create a list of all display name values from the json data.', 'duration': 412.788, 'highlights': ['Explaining JSON data conversion into Python objects and accessing information stored in dictionaries The chapter explains how to open a JSON file, convert its data into a Python object using JSON.load, and access information stored in dictionaries to create a list of display name values.', "Demonstrating accessing and displaying the value of a specific key in a dictionary The chapter demonstrates accessing and displaying the entire value of a specific key (e.g., 'results') in a dictionary from the JSON data.", 'Illustrating the process of accessing and working with nested dictionaries and lists in Python The chapter illustrates accessing and working with nested dictionaries and lists, showing how to access list items using their index and explaining the nesting structure in the JSON data.']}], 'duration': 606.977, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/oQfNYqz8pLs/pics/oQfNYqz8pLs2335.jpg', 'highlights': ['Covers the main topic of the chapter, focusing on accessing nested dictionaries in Python.', 'Details the objective of creating a list of names from a Q&A thread in the Angular 7 course on Udemy, emphasizing practical application.', 'Provides specific steps on accessing data in JSON format and utilizing the JSON encoder to open the file, demonstrating practical implementation.', 'The chapter explains how to open a JSON file, convert its data into a Python object using JSON.load, and access information stored in dictionaries to create a list of display name values.', "The chapter demonstrates accessing and displaying the entire value of a specific key (e.g., 'results') in a dictionary from the JSON data.", 'The chapter illustrates accessing and working with nested dictionaries and lists, showing how to access list items using their index and explaining the nesting structure in the JSON data.']}, {'end': 1050.067, 'segs': [{'end': 668.505, 'src': 'heatmap', 'start': 636.199, 'weight': 0.708, 'content': [{'end': 641.322, 'text': 'So here we could call this maybe question data, something like that.', 'start': 636.199, 'duration': 5.123}, {'end': 642.782, 'text': 'You can name this as you prefer.', 'start': 641.522, 'duration': 1.26}, {'end': 646.804, 'text': 'The important thing is that you then add in and in what?', 'start': 643.222, 'duration': 3.582}, {'end': 654.667, 'text': 'Well, in our question access, because we basically want to retrieve the information we have in our list right here.', 'start': 647.124, 'duration': 7.543}, {'end': 657.869, 'text': 'So for that, we enter in question.', 'start': 654.928, 'duration': 2.941}, {'end': 668.505, 'text': 'access like this and now we simply print our question data that we defined right here.', 'start': 660.295, 'duration': 8.21}], 'summary': 'Retrieve and print the question data to access information from the list.', 'duration': 32.306, 'max_score': 636.199, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/oQfNYqz8pLs/pics/oQfNYqz8pLs636199.jpg'}, {'end': 688.306, 'src': 'embed', 'start': 660.295, 'weight': 2, 'content': [{'end': 668.505, 'text': 'access like this and now we simply print our question data that we defined right here.', 'start': 660.295, 'duration': 8.21}, {'end': 671.608, 'text': "So let's see what the result will look like.", 'start': 669.165, 'duration': 2.443}, {'end': 680.54, 'text': 'And as you can see, the result looks quite good because now we were able to access the information in our list.', 'start': 672.734, 'duration': 7.806}, {'end': 684.543, 'text': 'Have a look at the square bracket at the square brackets, which are gone now.', 'start': 680.9, 'duration': 3.643}, {'end': 688.306, 'text': 'And now we can basically display the actual content.', 'start': 685.103, 'duration': 3.203}], 'summary': 'Accessed and printed question data, successfully removing square brackets.', 'duration': 28.011, 'max_score': 660.295, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/oQfNYqz8pLs/pics/oQfNYqz8pLs660295.jpg'}, {'end': 738.733, 'src': 'embed', 'start': 711.844, 'weight': 1, 'content': [{'end': 719.006, 'text': 'we learned how we can access dictionaries and how we can access lists, and as we have both kind of nested into each other,', 'start': 711.844, 'duration': 7.162}, {'end': 724.647, 'text': 'we can now use the information we learned previously and access our information in our dictionary.', 'start': 719.006, 'duration': 5.641}, {'end': 729.869, 'text': 'remember, we can now access a specific key in our dictionary to retrieve the value.', 'start': 724.647, 'duration': 5.222}, {'end': 732.55, 'text': 'now, which keys do we have in our dictionary?', 'start': 729.869, 'duration': 2.681}, {'end': 738.733, 'text': 'well, we basically have the class key, the question, not the question, the course key.', 'start': 732.55, 'duration': 6.183}], 'summary': 'Learned how to access nested dictionaries and lists for retrieving specific keys and values.', 'duration': 26.889, 'max_score': 711.844, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/oQfNYqz8pLs/pics/oQfNYqz8pLs711844.jpg'}, {'end': 812.142, 'src': 'embed', 'start': 785.721, 'weight': 3, 'content': [{'end': 789.323, 'text': "Well, actually we didn't, because we printed our replies.", 'start': 785.721, 'duration': 3.602}, {'end': 795.507, 'text': 'so we can access the replies key or the value the replies key contains, but we printed this one right here.', 'start': 789.323, 'duration': 6.184}, {'end': 797.269, 'text': 'So the last reply,', 'start': 795.768, 'duration': 1.501}, {'end': 805.394, 'text': 'because what Python basically does with our logic is it basically has a look at all the information it has and returns the last matching information.', 'start': 797.269, 'duration': 8.125}, {'end': 807.675, 'text': 'So the last matching key that we have right here.', 'start': 805.554, 'duration': 2.121}, {'end': 812.142, 'text': "We'll have a look at how we can quickly solve this in a few seconds.", 'start': 808.656, 'duration': 3.486}], 'summary': 'Python logic returns last matching key or value in replies.', 'duration': 26.421, 'max_score': 785.721, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/oQfNYqz8pLs/pics/oQfNYqz8pLs785721.jpg'}, {'end': 1056.798, 'src': 'embed', 'start': 1026.178, 'weight': 0, 'content': [{'end': 1031.143, 'text': 'And now this function will not be built from scratch because we actually have all the information we need.', 'start': 1026.178, 'duration': 4.965}, {'end': 1042.276, 'text': 'We just have to combine it in a function to make sure this function runs our loops again and again up until it found all the relevant information that we need.', 'start': 1031.544, 'duration': 10.732}, {'end': 1050.067, 'text': 'so what this means for us is up until it found all the display name keys and returned all the corresponding values.', 'start': 1042.276, 'duration': 7.791}, {'end': 1056.798, 'text': 'Now, to get started, we have to scroll up a little bit up to here right there.', 'start': 1050.891, 'duration': 5.907}], 'summary': 'Combining existing information into a function to run loops until all relevant data is found.', 'duration': 30.62, 'max_score': 1026.178, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/oQfNYqz8pLs/pics/oQfNYqz8pLs1026178.jpg'}], 'start': 610.072, 'title': 'Accessing and retrieving data in python', 'summary': 'Demonstrates how to access and retrieve information from nested dictionaries and lists in python using for loops and key access, resulting in successful retrieval of information, and explains the need to implement a function to return all the display names.', 'chapters': [{'end': 807.675, 'start': 610.072, 'title': 'Accessing and retrieving data in python', 'summary': 'Demonstrates how to access and retrieve information from nested dictionaries and lists in python using for loops and key access, resulting in successful retrieval of information from the given data structure.', 'duration': 197.603, 'highlights': ['The chapter demonstrates how to access and retrieve information from nested dictionaries and lists in Python using for loops and key access.', 'The result of accessing the information in the list looks quite good, as demonstrated by the removal of the square brackets and the successful display of the actual content.', 'Python allows the accessing of nested dictionaries and lists by using the information learned previously and accessing the information in the dictionary.', "Accessing the 'replies' key returns the last matching information, demonstrating Python's behavior of returning the last matching key in the logic."]}, {'end': 1050.067, 'start': 808.656, 'title': 'Accessing nested data in python', 'summary': 'Explains how to access nested data in python, using for loops to retrieve and save display names from nested dictionaries and lists, and emphasizes the need to implement a function to return all the display names.', 'duration': 241.411, 'highlights': ['Using for loops to access nested data in Python The chapter demonstrates the use of for loops to access nested dictionaries and lists to retrieve information.', 'Retrieving and printing display names The chapter explains the process of retrieving and printing display names from nested dictionaries, emphasizing the need to access specific keys within the nested data.', 'Importance of implementing a function to return all display names Emphasizes the need to implement a function in Python to return all the display names instead of just one, by running loops to find and return all the relevant information.']}], 'duration': 439.995, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/oQfNYqz8pLs/pics/oQfNYqz8pLs610072.jpg', 'highlights': ['Emphasizes the need to implement a function in Python to return all the display names instead of just one, by running loops to find and return all the relevant information.', 'Demonstrates how to access and retrieve information from nested dictionaries and lists in Python using for loops and key access.', 'The result of accessing the information in the list looks quite good, as demonstrated by the removal of the square brackets and the successful display of the actual content.', "Accessing the 'replies' key returns the last matching information, demonstrating Python's behavior of returning the last matching key in the logic."]}, {'end': 1203.023, 'segs': [{'end': 1097.718, 'src': 'embed', 'start': 1071.434, 'weight': 2, 'content': [{'end': 1075.358, 'text': 'But as soon as we opened our file, we want to run our function.', 'start': 1071.434, 'duration': 3.924}, {'end': 1080.602, 'text': 'And then this function should give us back the values of the results key right here in our dictionary.', 'start': 1075.518, 'duration': 5.084}, {'end': 1081.864, 'text': "So let's paste this right here.", 'start': 1080.763, 'duration': 1.101}, {'end': 1090.671, 'text': 'So, with the access to the values of the results key, we can scroll up once again, not up to here, up to here now,', 'start': 1082.824, 'duration': 7.847}, {'end': 1096.397, 'text': "because now we can take the for loop without the print statement, because we don't need to print our data.", 'start': 1090.671, 'duration': 5.726}, {'end': 1097.718, 'text': 'Now we only need to for loop.', 'start': 1096.437, 'duration': 1.281}], 'summary': 'Executing function provides access to results key for looping.', 'duration': 26.284, 'max_score': 1071.434, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/oQfNYqz8pLs/pics/oQfNYqz8pLs1071434.jpg'}, {'end': 1209.286, 'src': 'embed', 'start': 1184.774, 'weight': 0, 'content': [{'end': 1190.437, 'text': 'put it into a function and also made sure that with this for loops now integrated in this function,', 'start': 1184.774, 'duration': 5.663}, {'end': 1196.76, 'text': 'that we will not only retrieve back one single result, so not only one single name right here, but actually,', 'start': 1190.437, 'duration': 6.323}, {'end': 1203.023, 'text': 'With that logic right here being part of that function and running all these for loops for all the results it can find,', 'start': 1196.98, 'duration': 6.043}, {'end': 1209.286, 'text': 'it should actually give us back the names of all the persons who answered any question in our course right here.', 'start': 1203.023, 'duration': 6.263}], 'summary': 'A function was created to retrieve names of all course respondents.', 'duration': 24.512, 'max_score': 1184.774, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/oQfNYqz8pLs/pics/oQfNYqz8pLs1184774.jpg'}], 'start': 1050.891, 'title': 'Python file reading and function logic', 'summary': 'Discusses opening files, reading content, running functions, and using for loops to access values in python. it covers file handling and dictionary and list manipulation.', 'chapters': [{'end': 1203.023, 'start': 1050.891, 'title': 'Python file reading and function logic', 'summary': 'Discusses the process of opening a file, reading its content, running a function, and utilizing for loops to access and retrieve values from dictionaries and lists in python.', 'duration': 152.132, 'highlights': ['The process involves opening a file, reading its content, and running a function before accessing the values of the results key in a dictionary.', 'Utilizing for loops to access list items and retrieve values from a dictionary, ensuring the function can retrieve multiple results.', 'The chapter presents the process of summarizing and organizing code into a function, integrating for loops to retrieve multiple results from dictionaries and lists.']}], 'duration': 152.132, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/oQfNYqz8pLs/pics/oQfNYqz8pLs1050891.jpg', 'highlights': ['The chapter presents the process of summarizing and organizing code into a function, integrating for loops to retrieve multiple results from dictionaries and lists.', 'Utilizing for loops to access list items and retrieve values from a dictionary, ensuring the function can retrieve multiple results.', 'The process involves opening a file, reading its content, and running a function before accessing the values of the results key in a dictionary.']}, {'end': 1485.087, 'segs': [{'end': 1249.793, 'src': 'embed', 'start': 1226.594, 'weight': 1, 'content': [{'end': 1235.701, 'text': 'And if we do that, we can see that we indeed get back a list of all the people who gave an answer in the corresponding course.', 'start': 1226.594, 'duration': 9.107}, {'end': 1241.485, 'text': "So that's cool, but actually I wanted to save this information now to a new JSON file.", 'start': 1236.141, 'duration': 5.344}, {'end': 1245.268, 'text': 'For that, we have to tweak our code one less time a little bit.', 'start': 1242.245, 'duration': 3.023}, {'end': 1249.793, 'text': 'The first thing I want to do right here is I want to create an empty list.', 'start': 1246.069, 'duration': 3.724}], 'summary': 'Extracted a list of people who gave an answer and saved it to a new json file.', 'duration': 23.199, 'max_score': 1226.594, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/oQfNYqz8pLs/pics/oQfNYqz8pLs1226594.jpg'}, {'end': 1348.184, 'src': 'embed', 'start': 1317.706, 'weight': 2, 'content': [{'end': 1320.408, 'text': 'We should now be able to add the information to our list.', 'start': 1317.706, 'duration': 2.702}, {'end': 1330.677, 'text': 'So if we run this code right here and now run our get usernames function like that, and if you now access your list right here,', 'start': 1320.548, 'duration': 10.129}, {'end': 1340.839, 'text': 'so by just typing save data, you can see that we indeed created a list right here which contains all our names that we have.', 'start': 1330.677, 'duration': 10.162}, {'end': 1348.184, 'text': "Now, the problem still is that we don't save that to a file, but this can now be added easily by simply deleting that.", 'start': 1341.599, 'duration': 6.585}], 'summary': 'Code successfully creates a list of names, but needs file-saving functionality.', 'duration': 30.478, 'max_score': 1317.706, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/oQfNYqz8pLs/pics/oQfNYqz8pLs1317706.jpg'}, {'end': 1408.655, 'src': 'embed', 'start': 1381.81, 'weight': 0, 'content': [{'end': 1390.355, 'text': 'Now we want to turn the Python object back to a file which contains JSON data, so we simply add JSON.dump right here, so load becomes dump.', 'start': 1381.81, 'duration': 8.545}, {'end': 1399.112, 'text': 'Now, what information should be part of that file? Well, it should, of course, be our save data right here.', 'start': 1392.529, 'duration': 6.583}, {'end': 1408.655, 'text': 'So we enter save data and now we add file this one right here once again to the end of our code.', 'start': 1399.952, 'duration': 8.703}], 'summary': 'Convert python object to json file using json.dump with save data.', 'duration': 26.845, 'max_score': 1381.81, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/oQfNYqz8pLs/pics/oQfNYqz8pLs1381810.jpg'}], 'start': 1203.023, 'title': 'Extracting user names and processing json data in python', 'summary': 'Demonstrates how to extract user names from questions and save them to a json file using python, creating a list of user names and saving it to a json file. additionally, it emphasizes the process of converting python objects to json data and provides a practical example of storing information in a json file.', 'chapters': [{'end': 1340.839, 'start': 1203.023, 'title': 'Extracting user names and saving to json', 'summary': 'Demonstrates how to extract user names who answered questions and save the information to a new json file using python. the code creates a list of user names and appends the result of the function to the list, resulting in a json file with all user names.', 'duration': 137.816, 'highlights': ['The code creates a list of user names and appends the result of the function to the list. The script creates an empty list called save data and appends the user names to this list using the append method.', 'Demonstrates how to extract user names who answered questions and save the information to a new JSON file. The chapter details the process of extracting user names of people who answered questions in a course and saving this information to a new JSON file.', 'The chapter demonstrates how to use Python to accomplish this task. The content focuses on using Python to extract user names and save the information to a JSON file.']}, {'end': 1485.087, 'start': 1341.599, 'title': 'Python json data processing', 'summary': 'Demonstrates how to use python to write json data to a file, emphasizing the process of converting python objects to json data and saving it, ultimately providing a practical example of how to store information in a json file.', 'duration': 143.488, 'highlights': ['The chapter demonstrates the process of converting Python objects to JSON data and saving it to a file, providing a practical example.', 'The tutorial includes a demonstration of writing JSON data to a file, which can be useful for storing information.', "The video also covers the concept of using 'JSON.dump' to turn Python objects into a file containing JSON data."]}], 'duration': 282.064, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/oQfNYqz8pLs/pics/oQfNYqz8pLs1203023.jpg', 'highlights': ['The chapter demonstrates the process of converting Python objects to JSON data and saving it to a file, providing a practical example.', 'The chapter details the process of extracting user names of people who answered questions in a course and saving this information to a new JSON file.', 'The code creates a list of user names and appends the result of the function to the list. The script creates an empty list called save data and appends the user names to this list using the append method.']}], 'highlights': ['Covers the main topic of the chapter, focusing on accessing nested dictionaries in Python.', 'Details the objective of creating a list of names from a Q&A thread in the Angular 7 course on Udemy, emphasizing practical application.', 'Provides specific steps on accessing data in JSON format and utilizing the JSON encoder to open the file, demonstrating practical implementation.', 'The chapter explains how to open a JSON file, convert its data into a Python object using JSON.load, and access information stored in dictionaries to create a list of display name values.', "The chapter demonstrates accessing and displaying the entire value of a specific key (e.g., 'results') in a dictionary from the JSON data.", 'The chapter illustrates accessing and working with nested dictionaries and lists, showing how to access list items using their index and explaining the nesting structure in the JSON data.', 'Emphasizes the need to implement a function in Python to return all the display names instead of just one, by running loops to find and return all the relevant information.', 'Demonstrates how to access and retrieve information from nested dictionaries and lists in Python using for loops and key access.', 'The result of accessing the information in the list looks quite good, as demonstrated by the removal of the square brackets and the successful display of the actual content.', "Accessing the 'replies' key returns the last matching information, demonstrating Python's behavior of returning the last matching key in the logic.", 'The chapter presents the process of summarizing and organizing code into a function, integrating for loops to retrieve multiple results from dictionaries and lists.', 'Utilizing for loops to access list items and retrieve values from a dictionary, ensuring the function can retrieve multiple results.', 'The process involves opening a file, reading its content, and running a function before accessing the values of the results key in a dictionary.', 'The chapter demonstrates the process of converting Python objects to JSON data and saving it to a file, providing a practical example.', 'The chapter details the process of extracting user names of people who answered questions in a course and saving this information to a new JSON file.', 'The code creates a list of user names and appends the result of the function to the list. The script creates an empty list called save data and appends the user names to this list using the append method.']}