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,所以想学习一下

Screen Shot 2017-11-07 at 8.01.47 PM.png

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下载

Screen Shot 2017-11-07 at 8.04.33 PM.png
After Installing “Anaconda”, I setup my environment

下完"Anaconda"后就可以setup environment 了

Screen Shot 2017-11-07 at 8.06.14 PM.png
Then I start the Jupyter notebook, wow

然后就可以跑Jupyter notebook了,原来那么先进,好棒

Screen Shot 2017-11-07 at 8.12.19 PM.png
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)

Screen Shot 2017-11-07 at 8.16.07 PM.png
Ok, now i want to get the one level deep,into 'result'

好了,现在得到数据了,可以更进一层,进去'result'

Screen Shot 2017-11-07 at 8.18.32 PM.png
one more level, into 'buy'

更进一层,进去'buy'

Screen Shot 2017-11-07 at 8.19.06 PM.png
one more level, into 0 (mean i want the first row)

更进一层,进去0 (代表我只要第一排)

Screen Shot 2017-11-07 at 8.19.42 PM.png
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

谢谢阅读

H2
H3
H4
3 columns
2 columns
1 column
9 Comments