1 00:00:00,200 --> 00:00:03,960 Welcome back everybody. At this point, 2 00:00:03,960 --> 00:00:05,940 you have the machinery for extracting data 3 00:00:05,940 --> 00:00:08,775 from complex nested data structures. 4 00:00:08,775 --> 00:00:11,220 One of the biggest challenges is just 5 00:00:11,220 --> 00:00:13,425 understanding the structure of the data you have. 6 00:00:13,425 --> 00:00:15,945 Hopefully it'll have a consistent structure. 7 00:00:15,945 --> 00:00:18,210 For example, if there is a list of dictionaries, 8 00:00:18,210 --> 00:00:19,845 everything will be a lot easier 9 00:00:19,845 --> 00:00:22,815 if all the dictionaries have the same keys. 10 00:00:22,815 --> 00:00:25,275 Now once you understand the structure, 11 00:00:25,275 --> 00:00:27,240 you can figure out how to write the code. 12 00:00:27,240 --> 00:00:29,865 In the end, you might not need much code, 13 00:00:29,865 --> 00:00:33,360 but if you try to just write it all out all at once, 14 00:00:33,360 --> 00:00:35,785 it'll be very frustrating. 15 00:00:35,785 --> 00:00:37,640 You'll take a long time to debug it. 16 00:00:37,640 --> 00:00:39,410 So go through the understand, extract, 17 00:00:39,410 --> 00:00:42,560 repeat process testing your partial code at each stage, 18 00:00:42,560 --> 00:00:46,000 and you'll solve your coding problems a lot faster. 19 00:00:46,000 --> 00:00:49,640 One valuable heuristic you may want to remember is that 20 00:00:49,640 --> 00:00:50,990 if the data you want to access 21 00:00:50,990 --> 00:00:52,640 is nested three levels deep, 22 00:00:52,640 --> 00:00:54,275 a list inside a list, 23 00:00:54,275 --> 00:00:56,450 inside another list, then you'll need 24 00:00:56,450 --> 00:00:59,224 that same number three of extraction operations, 25 00:00:59,224 --> 00:01:03,050 some combination of square brackets and for loops. 26 00:01:03,050 --> 00:01:05,030 I'll leave you with a silly joke 27 00:01:05,030 --> 00:01:07,765 and some serious pearls of wisdom. 28 00:01:07,765 --> 00:01:10,895 Since we talked about deep and shallow copies, 29 00:01:10,895 --> 00:01:14,285 what's a tiger running a copy machine called? 30 00:01:14,285 --> 00:01:17,245 A copycat, of course. 31 00:01:17,245 --> 00:01:20,780 Some deeper wisdom about complexity inspired by 32 00:01:20,780 --> 00:01:22,700 the more complicated nested data 33 00:01:22,700 --> 00:01:24,680 that we've learned how to process. 34 00:01:24,680 --> 00:01:28,010 Confucius said, "Life is really simple, 35 00:01:28,010 --> 00:01:30,564 but we insist on making it complicated." 36 00:01:30,564 --> 00:01:33,075 Folk musician Pete Seeger said, 37 00:01:33,075 --> 00:01:35,535 "Any darn fool can make something complex. 38 00:01:35,535 --> 00:01:38,665 It takes a genius to make something simple." 39 00:01:38,665 --> 00:01:41,090 Management guru Tom Peters, 40 00:01:41,090 --> 00:01:43,985 writing about chaos in organizations said, 41 00:01:43,985 --> 00:01:45,545 "If you're not confused, 42 00:01:45,545 --> 00:01:47,405 you're not paying attention." 43 00:01:47,405 --> 00:01:50,250 I'm not sure about that last one. 44 00:01:50,250 --> 00:01:53,060 I hope you're not confused about nested data structures, 45 00:01:53,060 --> 00:01:57,390 no matter how complex they get. I'll see you next time.