python支持哪两种编程_在线编程从哪里进去啊,对于python支持例如numpy这样的包吗 ,还是得自己import啊...

#在线编程从哪里进去啊,对于python支持例如numpy这样的包吗 ,还是得自己import啊

#如题,如题,找不到入口诶,请问这个在线编程支持诸如python的统计画图吗,比如这段代码

import sys

import numpy as np

import matplotlib.pyplot as plt

def get_data():

# example data

mu = 100 # mean of distribution

sigma = 15 # standard deviation of distribution

x = mu + sigma * np.random.randn(10000)

return x

#you can write your code here

#def draw(IMG_PATH):

#get input data

def draw():

x = get_data()

print 'data is : '+str(x)

# the histogram of the data

plt.hist(x, bins=50, color='g', alpha=0.5)

#show image

plt.show()

print 'i excute it'

# plt.savefig(IMG_PATH)

#the code should not be changed

"""if __name__ == '__main__':

if len(sys.argv)==1:

print 'error'

else:

#the path of image to show

IMG_PATH = sys.argv[1]+'fig.jpg'

draw(IMG_PATH)"""

draw()

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值