First time learn Python,第一次学python
Hello Steemit Friends, today I wanna talk about some Python programming, its a very powerful web programming language, and I just learned from scratch today
每天看到@justyy,@oflyhigh那么厉害programming 尤其是python,我也想恶补一下,虽然我本身也是程序员,可是工作上并没有用到python,所以想学习一下
First I download "Anaconda", 首先先下载"Anaconda"
Because they said using Anaconda for python programming is easier where you can setup different environment for different project,the download size is 500MB ++
用"Anaconda"来跑Python是因为他们说不同的project可以有不同的environment比较方便,500多MB下载
After Installing “Anaconda”, I setup my environment
下完"Anaconda"后就可以setup environment 了
Then I start the Jupyter notebook, wow
然后就可以跑Jupyter notebook了,原来那么先进,好棒
Then here I just wanna do a simple json parsing, reading data from bittrex for BTC-STRAT
这里我只是要做简单的读取网上的bittrex json数据BTC-STRAT,然后慢慢拆分
import pandas as pd
mydata = pd.read_json('https://bittrex.com/api/v1.1/public/getorderbook?market=BTC-STRAT&type=both')
print(mydata)
Ok, now i want to get the one level deep,into 'result'
好了,现在得到数据了,可以更进一层,进去'result'
one more level, into 'buy'
更进一层,进去'buy'
one more level, into 0 (mean i want the first row)
更进一层,进去0 (代表我只要第一排)
one more level, into 'Rate'
更进一层,进去'Rate'
Finally get the data i want, which is the latest buy price for BTC-STRAT in Bittrex, awesome
千辛万苦,终于得到我要的号码了,就是BTC-STRAT 在Bittrex的最新买价
thanks for reading
谢谢阅读
恭喜你!您的这篇文章入选 @justyy 今日榜单 【优秀被错过的文章】, 请继续努力!
Congratulations! This post has been selected by @justyy as today's 【Good Posts You May Miss】, Steem On!
img credz: pixabay.com
Nice, you got a 62.0% @glitterbooster upgoat, thanks to @fundurian
Want a boost? Minnowbooster's got your back!
你今天心情如何?请接受cn区点赞机器人 @cnbuddy 对你作为cn区一员的感谢。 @cnbuddy 很开心能够和您一起为cn区快速发展,贡献自己的力量。我的主页会定期总结cn区活动动态,欢迎围观。假如我的留言打扰到你,请回复“取消”。
This post has received a 7.69 % upvote from @sleeplesswhale thanks to: @steem-buzz.
感谢分享
太客气了,大师
怎么这么巧,我最近也想开始学。你是用Mac? 我想在Windows上试试看。
是的,以前为了要写app给iphone就买了mac,用window其实比较方便啦