View this post on Hive: [Python Tips] Named Tuples
[Python Tips] Named Tuples
7 years ago by themarkymark (78)
$142.56
- Past Payouts $142.56
- - Author $126.63
- - Curators $15.93
118 votes
- + upmyvote: $77.026 (67.95%)
- + ipromote: $43.310 (100%)
- + busy.pay: $8.160 (6.06%)
- + trevonjb: $4.678 (10%)
- + lordgod: $2.500 (10%)
- + rznag: $1.324 (50%)
- + hairshares: $1.268 (100%)
- + pharesim: $0.560 (0.38%)
- + techslut: $0.505 (30%)
- + stabilowl: $0.421 (49%)
- + playfulfoodie: $0.387 (20%)
- + fivefiveeleven: $0.211 (50%)
- + purepinay: $0.164 (5%)
- + nicnas: $0.133 (50%)
- + cervisia: $0.133 (100%)
- + thecryptodrive: $0.118 (20%)
- + investfourmore: $0.109 (20%)
- + derrick829: $0.098 (1%)
- + topkpop: $0.097 (10%)
- + kenistyles: $0.096 (11%)
- … and 98 more
https://steemit.com/steemit/@michaellamden68/themarkymark
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thank you @themarkymark. Your tips are so great to the programming community of Steemit.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Sir I am very interested in learning programming. i know html. now I want to know python.
your post inspire me to learn it.
thank you very much sir for your valuable post.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Hi nice article.....Keep writing that's like article and let's help each other also checkout my post click here
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Can you comment on when is it better to use a namedtuple vs a dictionary and vice versa?
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
A named tuple does not require a key and is not required to be hashable. Named tuples are ordered, unlike a dict. You can also use dot notation instead of [' '] which is a bit easier to type and has some readability improvements.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thanks! I use python for data analysis but rarely use things like namedtuple and dictionary. By ordered I suppose you mean that if I want to, I can iterate through a namedtuple but not a dictionary?
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
When you use a dict, there is no guarantee you will get the keys in the order you created them. Access is typically by key so that's not important.
WIth named tuple, you know the first element, will always be returned first.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Cool! Thanks for the tips!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thanks for this lecture on tuple. Programming is life
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Congratulations @themarkymark! You have completed some achievement on Steemit and have been rewarded with new badge(s) :
Award for the number of comments
Click on any badge to view your own Board of Honor on SteemitBoard.
To support your work, I also upvoted your post!
For more information about SteemitBoard, click here
If you no longer want to receive notifications, reply to this comment with the word
STOP
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Is @upmyvote your bot ? I transfered $3 SBD before the last round ended but never got my vote. I skimmed it's recent article ( 3 months old ) and seen you replying. Sorry to hijack your topic.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Sent a refund, please use our #support on Discord in the future.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thanks !
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit