You are viewing a single comment's thread from:

RE: Altcoin Portfolio The Pythonic Way - Have FUN & LEARN a New Skill!

in #bitcoin8 years ago (edited)

Thank you (from Python beginner) for your example and I hope more will be coming :-) This one was very useful for me.

I was just wondering how to get certain data from coinmarketcap. I knew I can loop through the dictionaries inside that json and print out data like this: (example is for STEEM)

print(data[19]['symbol'], data[19]['price_usd'])

But I was wondering, how to make sure to always get data for say STEEM, because when STEEM changes rank and ends on say 18th place, upper line of code will return data for different crypto currency.

Well, you just showed me, how to elegantly solve this by creating list of id's I want data for and then get the info with:

if name in ids:

Cool, solves the problem currencies changing their 'rank', their position.

Thanks, very appreciated!

Sort:  

Glad the example was helpful to you. Full Steem ahead :)

Did you figure out how to add the pie chart?

Sorry, haven't touched computer since. I'm not ready for matplotlib yet anyway, maybe in a year, :-)
I'm old & slow learner with not enough free time...