Тёмный

How to Use Python Dictionaries + Lists of Dicts 

John Watson Rooney
Подписаться 89 тыс.
Просмотров 61 тыс.
50% 1

Опубликовано:

 

30 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 53   
@damienang7863
@damienang7863 2 года назад
Thank you so much man! My school taught us about basics of dictionaries (without list of dicts) and there are lists of dicts included in assignment and they expects us do complete it. luckily there is this vid!!
@tidoblack2054
@tidoblack2054 Год назад
Amazing explanation, very simple, and straigtht to the point.
@aicode2304
@aicode2304 2 года назад
Thank you for this video, you explained things no one else has explained. God bless
@JohnWatsonRooney
@JohnWatsonRooney 2 года назад
Thank you very kind
@aicode2304
@aicode2304 2 года назад
@@JohnWatsonRooney also, i know this sounds really random, but im asking people if they believe in an afterlife or in God. I dont want to take too much time away from you though
@princessnnene3901
@princessnnene3901 Год назад
@@aicode2304Keep spreading the good word my friend! Jesus is the Way, the Truth and the Life! :)
@brentsimpson3791
@brentsimpson3791 2 года назад
Thanks, you just cleared up some confusion. Thank you!
@oglothenerd
@oglothenerd 2 года назад
OMG! Another Linux user! Hey bro! I use Linux too!
@Zoid-Berg
@Zoid-Berg Год назад
continue doing full python tutorial plz it will be very helpful !
@alejandroluisbarcala8481
@alejandroluisbarcala8481 Год назад
Thanks John! This video has been very instructive to me!
@jonathanspencer8142
@jonathanspencer8142 Год назад
Hi John, thank you for the video. It was very helpful.
@kkaarroollpl1453
@kkaarroollpl1453 Год назад
Thats what i was looking for! Keep going with tutorials like that!!
@chiamakamibeanu5142
@chiamakamibeanu5142 2 года назад
Thank you so much for this video. It was helpful.
@geerliglecluse5297
@geerliglecluse5297 3 месяца назад
Nothing wrong with this video, well explained, very clear. In addition to this, it would be great to see a video how to get data into a collection of lists, dictionaries or combination of those instead of starting with a given collection. There are very few videos about that and as a beginner that is really a challenge once you try to get out of the tutorials and try building your own stuff.
@jmaca.
@jmaca. 3 месяца назад
agree
@matiasluiso770
@matiasluiso770 9 месяцев назад
Excellent explanation. Really thankfull.
@Richard-yz2gy
@Richard-yz2gy Год назад
well explained, will watch more of your videos for sure, cheers
@catyuzu3992
@catyuzu3992 Год назад
nice tutorial it surprise a little more in comparison with othhers
@easydatascience2508
@easydatascience2508 Год назад
Useful. You can also watch my playlist, Many useful and fundamental for Python crash course tutorial.
@bencole8301
@bencole8301 3 года назад
Thanks for sharing again John!
@damonchase4771
@damonchase4771 Год назад
Thank you for making this video
@JohnWatsonRooney
@JohnWatsonRooney Год назад
Glad it was helpful!
@krisztina5711
@krisztina5711 Год назад
thank you very much, it was very, very useful
@scyllajk2757
@scyllajk2757 9 месяцев назад
great bro, this is what I was looking for
@aminesahel4143
@aminesahel4143 10 месяцев назад
Thank you for this video. Very helpful!
@dzeykop
@dzeykop 3 года назад
Thank you John, great work, again
@barnabykent6698
@barnabykent6698 2 года назад
Excellent video, very useful. Thank you.
@ramonrochadev
@ramonrochadev Год назад
Really helpful, thanks a lot!
@JohnWatsonRooney
@JohnWatsonRooney Год назад
Glad it helped!
@LifeLongArtist
@LifeLongArtist Год назад
What do you do if you don't know the index or keys? Like when trying to autofill or auto grab data using a loop?
@rubao3000
@rubao3000 2 года назад
Hey John, thanks for the video. What If I want to get all the elements of the same key name? For example, all values from ['size']? How could I do it?
@Riyoshi000
@Riyoshi000 Год назад
Did you find an answer to that? Im trying to do the same now
@rubao3000
@rubao3000 Год назад
​@@Riyoshi000 Hey, man. I don't remember how I figured it out, but this may help you: products = [ {'name': 'shirt', 'size': 'M', 'price': 25.0}, {'name': 'pants', 'size': 'L', 'price': 45.0}, {'name': 'shoes', 'size': 10, 'price': 25.0}, {'name': 'shirt', 'size': 'M', 'price': 30.0} ] for i in products: print(i['size'])
@sandinstone
@sandinstone Год назад
@@rubao3000 Thanks it worked!
@leonardoplaza7677
@leonardoplaza7677 Год назад
What if I just want to print all of the names? Not specifying the index, just the key. For example: `print(products['name'])` And get all the names?
@mrboyban
@mrboyban Год назад
It is not complicate, people make the concept complicated, by talking too much. Teaching coding is about practicing not showing off what you understand about the topic.
@mauipomare6523
@mauipomare6523 8 месяцев назад
Backed me into a corner with that if it has lmk if it hasn't lmk
@rooftoprumble7845
@rooftoprumble7845 2 года назад
I have an issue that I can't seem to find anywhere. I have a dictionary with lists in it. All keys have multiple values which are integers how can I get the sum of each values in a specific key?
@JohnWatsonRooney
@JohnWatsonRooney 2 года назад
Hi - a dictionary key is a single value, not sure what you mean exactly. but you can get all the keys from a dictionary using yourdict.keys(). this will return a list of all the key values
@officialonbekende9785
@officialonbekende9785 Год назад
user = input( something ) user1 = input( 1 ) user2 = input( 2 ) output = dict = { 'something' : { '1':'1'}, 'something2' : { '2':'2'}} how can i create something like that? that user can self input as many as he wants nested lists
@chisengalungu119
@chisengalungu119 Год назад
thank you very much for the great video. I have a question. How do you get the index of an item in an array(the array that is a value in a dictionary)
@AMA-xi5vp
@AMA-xi5vp 2 года назад
Hi mate, at the end of the video How do I print only all the 'color' key? I mean: if I had a large list of dictionaires I can't type always the index and then the key, instead, I would print only all the 'color' keys because I want to know all the colors are in. I hope its clear enough, thanks in andvance
@ferguswalker7345
@ferguswalker7345 2 года назад
I'm new to python so take the suggestion with a pinch of salt, but I think you could use a for loop like this: for x in product: print(product[x][colour]) This should loop through all the dictionaries in the list, and for each one, print the colours available.
@GFreeland850
@GFreeland850 2 года назад
Can you show for example, when you enter a US state if will show the capital of that state?
@vishalnm3836
@vishalnm3836 Год назад
thanks
@oldmonk494
@oldmonk494 2 года назад
great video 👍😊
@ceballospy
@ceballospy 2 года назад
Do you have a video where you are making iteration over list of dicts and adding information from one list of dict to other?
@naveensrinivas21
@naveensrinivas21 Год назад
U may use 'append' with the help of keys and values from a dictionary
@krisztina5711
@krisztina5711 Год назад
Hi, I ask you to write, which index access only 'Peti' or 'Zsolt' in my list. Thank you. project_d=[ {'Y':{'name':'Zsolt'}}, {'X':{'name':'Peti'}}, {'V':{'name':'Zsolt'}} ] for i in range(len(project_d)): print (project_d[i])
@K3lvin.J
@K3lvin.J 2 года назад
How can I call the whole list of dictionary
@jorgeholguin2009
@jorgeholguin2009 11 месяцев назад
How do you access “itemid”: “1002” ?
@jorgeholguin2009
@jorgeholguin2009 11 месяцев назад
Oh!. I got it! products[1] Don’t bother to answer
Далее
Python - Accessing Nested Dictionary Keys
24:48
Просмотров 185 тыс.
This is How I Scrape 99% of Sites
18:27
Просмотров 140 тыс.
5 Good Python Habits
17:35
Просмотров 584 тыс.
How To Use List Comprehension In Python
6:41
Просмотров 10 тыс.
Python dictionaries are easy 📙
8:06
Просмотров 246 тыс.
10 Important Python Concepts In 20 Minutes
18:49
Просмотров 239 тыс.
Pydantic Tutorial • Solving Python's Biggest Problem
11:07
Python lists, sets, and tuples explained 🍍
15:06
Просмотров 297 тыс.
Is this how pro's scrape HUGE amounts of data?
20:34