First time learn Python,第一次学python

in #programming7 years ago

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

谢谢阅读

Sort:  

恭喜你!您的这篇文章入选 @justyy 今日榜单 【优秀被错过的文章】, 请继续努力!

Congratulations! This post has been selected by @justyy as today's 【Good Posts You May Miss】, Steem On!

Calling @originalworks :)
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其实比较方便啦

Coin Marketplace

STEEM 0.27
TRX 0.13
JST 0.032
BTC 60953.94
ETH 2920.49
USDT 1.00
SBD 3.57