Python - Accessing Nested Dictionary Keys

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 ก.ย. 2024
  • 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: acad.link/pyth...
    Download the source file: a.storyblok.co...
    What is a Dictionary: docs.python.or...
    What are Lists: docs.python.or...
    Want to learn something totally different? Check out all other courses: academind.com/...
    ----------
    • You can follow Max on Twitter (@maxedapps).
    • And you should of course also follow @academind_real.
    • You can also find us on Facebook.( / academindchannel )
    • Or visit our Website (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!

ความคิดเห็น • 252

  • @raghavendragowda3997
    @raghavendragowda3997 5 ปีที่แล้ว +10

    So delicate, detailed, precise and iterative explanation which can save any beginner or experienced Python developer's day. Hats off to the patience level and step-by-step explanation!!!

    • @academind
      @academind  5 ปีที่แล้ว

      Just wonderful to read that Raghavendra, thank you so much!

  • @rajguptaverma
    @rajguptaverma 3 ปีที่แล้ว +2

    No much nested code..... a very simple presentation..... a great video...finally got relevant information...Thank you

  • @aybikegundogdu9872
    @aybikegundogdu9872 ปีที่แล้ว +3

    This video saved me. I have been stuck on this task at my job for two weeks now and finally I see the light at the end of the tunnel 😂

    • @Deepathanya_1424
      @Deepathanya_1424 17 วันที่ผ่านมา

      even me, now it was helpful

  • @ininvideos
    @ininvideos 4 ปีที่แล้ว +36

    You did a good job explaining and breaking down nested lists and nested dictionaries in a json file. Best tutorial.

  • @bobdesilets2077
    @bobdesilets2077 3 ปีที่แล้ว +17

    I've struggled with understanding how to pull out specific information in nested dictionaries for a long time now. Not only do finally understand the type errors I was getting, I have a much better idea of how to do basic code development in Jupyter. Thank you!!!

    • @bobby_bouche
      @bobby_bouche ปีที่แล้ว +1

      this is me right now, I just failed a class quiz on extracting specific values from nested dictionaries. I feel so utterly dumb right now so here I am, diving into this vid to hopefully figure out why my stupid brain can't figure it out!

  • @ashxos
    @ashxos 3 ปีที่แล้ว +1

    This is Amazing! I was searching for nested list examples on blogs, youtube for a week. After one week, today I got this video in TH-cam Search. What a relief! This is the best video of Nested list example ever. Thanks a Lot!

  • @brentsimpson3791
    @brentsimpson3791 2 ปีที่แล้ว +1

    Mate! I'm new at Python, but this one video has unlocked the whole dictionary and table within a dictionary within a table thing...I had quite literally sampled numerous whiskeys over it... so if you're ever in NZ look me up.

  • @deepshah737
    @deepshah737 2 ปีที่แล้ว +1

    I am studying AWS boto3 and understanding Nested Dicts was a struggle for me for weeks! I can't believe how taught me this concept in few minutes! Thank you so much! I wish you great health!

  • @timlambert4955
    @timlambert4955 3 ปีที่แล้ว +6

    This was a really well done video. Well organised and executed. The teacher deserves Kudos!

    • @lailymedha595
      @lailymedha595 2 ปีที่แล้ว

      couldn't agree more! 🙌

  • @ParleysWoodedJourney
    @ParleysWoodedJourney 2 ปีที่แล้ว +1

    Thank you so much for this. It really helped that you went from dictionary to list to a dictionary to list . . .
    and then showed each step individually and then at the end showed how they can all be daisy-chained into nested loops.
    saved and added to my personal python playlist

  • @tmmason10
    @tmmason10 3 ปีที่แล้ว +1

    I looked all afternoon and this was so clear to understand.

  • @digambarmishra
    @digambarmishra ปีที่แล้ว +2

    I tried to download the source file but got message as access denied. Can you please give me access to this file.

  • @nataliagomes5541
    @nataliagomes5541 3 ปีที่แล้ว

    what an incredible explanation. Nothing on the internet compares to this video about json. Seriously, thank you so much!!!!! I paused the video all happy because I'm understanding to give thanks from my heart. Thank you! You have an amazing didactic, explain very well, in detail and with patience for beginners. I'll come back more often on your channel.

  • @puttygutt
    @puttygutt 3 ปีที่แล้ว +1

    Fantastic overview of navigating nested dictionaries! Incredibly helpful. Thank you.

  • @krishnakiranvajha3175
    @krishnakiranvajha3175 3 ปีที่แล้ว

    Explained the difficult nested json in a simpler way breaking down first then applied the same into python code ....I struggled writing complex ones ...after watching this I could write easily...Thanks so much !!

  • @TashieTash
    @TashieTash 4 ปีที่แล้ว +8

    Thank you so much! this helped me out! best tutorial ever!

  • @adamkeinan1535
    @adamkeinan1535 2 ปีที่แล้ว

    You are a genius! im a Senior DevOps Engineer and still learning from you each time!!! well done sir!!!

    • @adamkeinan1535
      @adamkeinan1535 2 ปีที่แล้ว

      @@MimiArtIIst Not really. i was implementing few of the methods shown in the video on a API

  • @palo8818
    @palo8818 ปีที่แล้ว

    I couldn't find the JSON file in description, but I followed using my own. Thank you ❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️

  • @samanthaanita
    @samanthaanita ปีที่แล้ว

    you're the GOAT. This kind of material is going to be present on my midterm tomorrow, and I felt so enlightened after watching this video. BIG UP TO YOU!!!

  • @aliyanpops6424
    @aliyanpops6424 3 ปีที่แล้ว

    Man Man Man I have been trying to figure this out for 2 days cause am a newbie, but you saved me...no you saved a lot of peeps out here. Thank you!!

  • @sarashan12
    @sarashan12 5 หลายเดือนก่อน

    Fantastic walk through and great way to grasp the flow even for a starter . Keep creating videos like this

  • @rchur
    @rchur 2 ปีที่แล้ว

    Hey Mate, thanks for the video. You did a good job in explaining how to write a parser for nested json. Today I successfully wrote my very first nested json parser after watching your TH-cam video many times.
    I would like to express my sincere gratitude to you. All the best and stay safe. Cheers
    Rchur

  • @timob12
    @timob12 2 ปีที่แล้ว

    Super helpful, will need to review this several times but you helped a lot with my confusions of how to access a Dict when it outputs a list and then becomes a Dict again and then outputs a list and so on. Need to keep reminding myself to take a step by step approach

  • @danielhaycraft7004
    @danielhaycraft7004 ปีที่แล้ว +1

    thank you for this! literally took two seconds to scan along what you were doing and i realized where i was going wrong lol! thank you!
    Subscribed**

    • @easydatascience2508
      @easydatascience2508 ปีที่แล้ว

      You can try mine too. The channel has both Python and R playlists, with downloadable source files.

  • @caioborgonha3900
    @caioborgonha3900 5 หลายเดือนก่อน

    Great job! This is really a practical example to train and use on our daily jobs

  • @alvaroramirez8151
    @alvaroramirez8151 2 ปีที่แล้ว

    Is it possible to find just the right video you were looking for? Yes. Great video

  • @forwardclarity
    @forwardclarity ปีที่แล้ว

    This has to be the best video on the subject I’ve seen. Thanks man!

  • @antonietapintorebelo5020
    @antonietapintorebelo5020 5 ปีที่แล้ว +5

    Thank you so much! You saved my ass for my Graduation Internship

    • @academind
      @academind  5 ปีที่แล้ว

      Happy to read that the video was helpful Antonieta :)

  • @user-hf5vf7fe1m
    @user-hf5vf7fe1m 11 หลายเดือนก่อน

    Thanks so much! I spent hours to go through TA's video but was still confused. This is definitely life-saving!

  • @eliyassala3505
    @eliyassala3505 3 ปีที่แล้ว +1

    Thanks! This is useful when first dealing with a raw JSON response and want to parse through the data to get specific values.

  • @fujimorikuro895
    @fujimorikuro895 5 ปีที่แล้ว +2

    This was helpful for me, your way of explaining is really spot on too, because even I understood what was being explained lolol, good job and thanks!

    • @academind
      @academind  5 ปีที่แล้ว

      Thank you Kuro, happy to read that the video was helpful!

  • @Theworldofeverything_67
    @Theworldofeverything_67 2 ปีที่แล้ว

    Best video for nested dictionaries 👍👍👍

  • @HSharpknifeedge
    @HSharpknifeedge 5 ปีที่แล้ว

    Thanks for the video. Although I suggest you explain to your viewers, that you are using the Python context manager. When people come here to learn, they can be easily misled that whenever they want to work with a .json file, it is necessary to use the context manager. We both know that you can open a .json without this method.

  • @ashwithullal
    @ashwithullal 3 ปีที่แล้ว

    Explained with super clarity.

  • @leodigiacomo
    @leodigiacomo ปีที่แล้ว

    This is great. explaining the logic and how to interpret the syntax. Thanks for this video!

  • @ParleysWoodedJourney
    @ParleysWoodedJourney 2 ปีที่แล้ว +1

    Is there a place we can still get the source file you used in your demonstration? The link in the description is dead.

  • @manojk1494
    @manojk1494 ปีที่แล้ว +2

    Hi, I am unable to download the source file from your link.
    Error: This XML file does not appear to have any style information associated with it. The document tree is shown below.
    AccessDenied
    Access Denied
    G8QDM85DPG3DQM5M
    b/XNC5DM7r2vWBPsjvLp6dzwiFuFzMz8oUAKKJlpKMTfnyAnYCvtPX1F3eJVfAPsY+gLPkojJtc=

  • @phsmack
    @phsmack 3 ปีที่แล้ว

    This video saved my sanity. Give this man a tasty craft beer...unless he is a recovering alcoholic, in which case give him whatever he wants that is equivalent to the tasty craft beer.

  • @detlefschulz-8879
    @detlefschulz-8879 4 ปีที่แล้ว +4

    Sehr gut erklärt, vielen Dank!

  • @xstuartfbarrettx
    @xstuartfbarrettx 5 ปีที่แล้ว +1

    Excellent walk through. It was exactly what I was looking for. Thank you!

    • @academind
      @academind  5 ปีที่แล้ว

      Thank you Stuart!

  • @ryhanuddin9373
    @ryhanuddin9373 2 ปีที่แล้ว

    Very Concise and to the point. Great video!

  • @S3shubham
    @S3shubham 3 ปีที่แล้ว

    love you ... brother ... for this.
    i learned something new for you ..... You help me in my journey of learning python

  • @cardozoveronica
    @cardozoveronica 3 หลายเดือนก่อน

    Super clear information here! thank you 💚

  • @cesarrivas3743
    @cesarrivas3743 4 ปีที่แล้ว

    Thanks for the good explanation, understanding that jsons are basically dictionarys and lists make a great impact!

  • @johnmartin9329
    @johnmartin9329 3 ปีที่แล้ว

    BEST tutorial on python good and simple explanation thanks keep it up man u rocks

  • @getacho
    @getacho 4 ปีที่แล้ว

    Excellent explanation about how to work with nested dictionaries. I was able to apply this knowledge with a very difficult json file. Thank you very much for your hard work.

  • @abbisalmi1948
    @abbisalmi1948 3 ปีที่แล้ว

    Thanks for the detailed explanation. Worth every minute.

  • @divyaarasu5057
    @divyaarasu5057 3 ปีที่แล้ว

    Incredible. The best tutorial video I have ever seen 😊

  • @sanobarlambey7997
    @sanobarlambey7997 4 ปีที่แล้ว +1

    Perfectly explained..thank you!

  • @xheer543
    @xheer543 2 ปีที่แล้ว

    INSANELY HELPFUL THANK YOU MUCH.

  • @wasislos
    @wasislos 4 ปีที่แล้ว

    Thanks man a lot, i was a bit confused with json i got, couldnt understand what to do, but after your video it all made sense.

  • @Rumi_Rune
    @Rumi_Rune 3 ปีที่แล้ว

    This is a great tutorial for my small project challenge.

  • @sth7721
    @sth7721 4 ปีที่แล้ว

    Very Nice Explanation in a simple manner. Keep it up. Thanks a Lot!!

  • @joringrant
    @joringrant 4 ปีที่แล้ว

    Is there anyway to do that without using nested for loops? Looking for something more efficient

  • @beenasindia8000
    @beenasindia8000 3 ปีที่แล้ว

    Best tutorial !! you made a difference to my learning . Thank you

  • @otroclinker
    @otroclinker 4 ปีที่แล้ว +1

    Thanks so much, it really helped me. Keep doing great courses.

  • @maximelebreux2914
    @maximelebreux2914 ปีที่แล้ว

    thank you very much for this tutoriel! Well explained!

  • @anwaralisathiopowershellac6093
    @anwaralisathiopowershellac6093 3 ปีที่แล้ว

    thanks you explained delicately the difficult one ..

  • @SriRam-yq4id
    @SriRam-yq4id 3 ปีที่แล้ว

    Excellent Video and thanks for teaching us.

  • @pukhrajsuthar7223
    @pukhrajsuthar7223 2 ปีที่แล้ว

    Great, work really Very clear and precise! This is what exactly industry-based example. Thank you so much.

  • @mommyfurry9596
    @mommyfurry9596 2 ปีที่แล้ว

    Very clear and precise! Just like industry-based example. Thank you so much, more powers!

  • @scoobontheweb
    @scoobontheweb ปีที่แล้ว

    awesome explanation path... Thank you very much

  • @deanmait
    @deanmait ปีที่แล้ว

    great tutorial , probably the best i've seen on nested dicts. the link to download the json file for practice seems to be broken though.

  • @SOMEONE-eq5bu
    @SOMEONE-eq5bu 2 ปีที่แล้ว

    very well simplified, much appreciate it.

  • @shailyrathore3071
    @shailyrathore3071 3 ปีที่แล้ว

    Well explained.
    I was looking for this kind of session from long back. Thanks a lot.

  • @will2see
    @will2see 4 ปีที่แล้ว +1

    Great tutorial. One question: What did you press (and what is in your VS Code settings apart pep8 formatting) to format the list from the json file? Thank you.

    • @martinbutkiewicz8953
      @martinbutkiewicz8953 4 ปีที่แล้ว

      seems vs code identifies this by the .json filename-extension. Once an .json file is loaded to VS Code press CTRL+ALT+F (like format)

  • @kaushikbose4988
    @kaushikbose4988 3 ปีที่แล้ว

    Fantastic explanation. Hope to see more from you.

  • @angeljiminian5305
    @angeljiminian5305 5 ปีที่แล้ว

    Thank you for the video. I noticed some peoples names came up more than once. It would have made sense in this lesson to have added the code to how you could have outputted results with non-repeated names.

  • @Germar0
    @Germar0 ปีที่แล้ว

    Thank you very much for this explanation!

  • @basicmaths3443
    @basicmaths3443 4 ปีที่แล้ว +1

    How to append that in separate columns of a dataframe?

  • @jndesign
    @jndesign 2 ปีที่แล้ว

    Thank you for this it really clarified things for me.

  • @info781
    @info781 4 ปีที่แล้ว

    Great video, great examples. I needed to learn how to get some data from Github Api v4. The json is very deep, 8 or 9 layers all different types lists, dict, tuples. Thanks for helping me.

  • @alejandrorosales
    @alejandrorosales 3 ปีที่แล้ว

    You have a new member!

  • @Chillos100
    @Chillos100 2 ปีที่แล้ว

    Brilliant!! Very well explained, thanks a lot!

  • @09nbnb
    @09nbnb 2 ปีที่แล้ว

    Thank You so much. Great video and exactly what I needed.

  • @avalealidzy6739
    @avalealidzy6739 3 ปีที่แล้ว

    Excellent tutorial!!!

  • @LukasNachtigall
    @LukasNachtigall 2 ปีที่แล้ว

    Thank you for that explanation. Is there ANY simpler way to access Keys and Values of nested Dictionaries?

  • @stefanvandenberg93
    @stefanvandenberg93 3 ปีที่แล้ว

    Excellent explenation! Helped me out so much! Thanks a ton! :D:D

  • @aiishg_
    @aiishg_ 3 ปีที่แล้ว

    How did you format the data in visual studio at the end of the video? Please let me know!

  • @chen3969
    @chen3969 4 ชั่วโมงที่ผ่านมา

    great video. I love it. Thanks you.

  • @mirkoobkircher2571
    @mirkoobkircher2571 4 ปีที่แล้ว +1

    Great stuff and super helpful! thanks so much for this. If I may ask one question on it:
    assuming in addition to "display_name" you'd also like to extract the value from "_class" key, how would you amend the code to end up with a 2d array for "save_data" instead of a 1d array with 1 column?
    e.x.: print(save_data)
    >>> [["user", "Maximilian Schwarzmüller"]["user","Bernd Raucher"]]
    thanks again!

  • @anantkumar-jz2sx
    @anantkumar-jz2sx 3 ปีที่แล้ว

    Awesome explanation.. do you have detailed course on python by same instructor?

  • @skeldon66
    @skeldon66 3 ปีที่แล้ว

    Great job explaining this topic thx

  • @alextsavalos5692
    @alextsavalos5692 3 ปีที่แล้ว

    excellent video !
    Perfect explanations and veery helpful !
    Thank you very much !

  • @ThiyaguShanmugam
    @ThiyaguShanmugam 4 ปีที่แล้ว

    Very clear explanation.

  • @russellsue8520
    @russellsue8520 2 ปีที่แล้ว

    Thank you very much for this tutorial ❤️

  • @muhammadnaveedkhan6739
    @muhammadnaveedkhan6739 3 ปีที่แล้ว

    Thank you sir. Excellent job

  • @aquas19
    @aquas19 ปีที่แล้ว +1

    Access is denied when downloading the json?

  • @jiaouyang6305
    @jiaouyang6305 2 ปีที่แล้ว

    Fantastic tutorial, thank you!

  • @pipedreamsnetwerk5110
    @pipedreamsnetwerk5110 ปีที่แล้ว

    This was amazing, thank you

  • @kreendurron
    @kreendurron 4 ปีที่แล้ว +4

    I try to make for loops make sense with naming. Eg
    for reply in data[replies]:
    print(reply)

  • @TheKauddin
    @TheKauddin 4 หลายเดือนก่อน

    What happened to the source file?

  • @lindaphan9234
    @lindaphan9234 5 ปีที่แล้ว

    Very clear explanation . Thank you!

  • @sagarsinghrajpoot3832
    @sagarsinghrajpoot3832 4 ปีที่แล้ว

    Amazing ...2 words ...super liked and subscribed 😀

    • @academind
      @academind  4 ปีที่แล้ว

      Thanks so much Sagar, so great to have you on board of our channel!

  • @Gglsucksbigballz
    @Gglsucksbigballz ปีที่แล้ว

    Thanks for the explanation. Coming from SQL this sines so overly laborious compared to a simple “where” clause.

  • @leica0000
    @leica0000 3 ปีที่แล้ว

    This is great - is the Jupyter notebook available?

  • @deepalikhandekar822
    @deepalikhandekar822 ปีที่แล้ว

    Hello, Can you help me with this problem, I want to check whether a key exists in the json file , if so then want to dump the whole data in which the key exist into new json file....

  • @maclanphere5674
    @maclanphere5674 4 ปีที่แล้ว

    very good--I've seen examples that use the methods of .values() and .items() when accessing dict/JSON data. You've managed without them. When are these useful?

  • @russellsue8520
    @russellsue8520 2 ปีที่แล้ว

    You just saved my life💙💛♥️

  • @healthdatascience6577
    @healthdatascience6577 4 ปีที่แล้ว

    This video is saving me. Thanks!