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
谢谢阅读