zoukankan      html  css  js  c++  java
  • python numpy 包积累

    2017.11.4

    np.ptp(array)#最大值和最小值之间的差值,peak to peak

    np.array(data).flatten()#展平数据,http://www.cnblogs.com/itdyb/p/5796834.html

    np.ones(N, dtype=np.bool)

    http://www.mamicode.com/info-detail-992832.html

     2017.11.5

    1.np.linspace(startstopnum=50)#生成指定区间下指定区间个数的区间的两端,Return evenly spaced numbers over a specified interval.

      np.linspace(5,10,3)#http://blog.csdn.net/grey_csdn/article/details/54561796;https://docs.scipy.org/doc/numpy/reference/generated/numpy.linspace.html

      Out[71]: array([ 5. , 7.5, 10. ])

    2.np.meshgrid(x,y)#生成网格点,转载自http://www.cnblogs.com/sunshinewang/p/6897966.html

      #其主要作用是用于绘制形如x**2+y**2的函数图形,先为x变化,y不发生变化,例如咋x=-2,-1,0,1时y=1;然后依次进行下去

      #一般会使用plt.imshow()进行画图,横         纵坐标为数据的索引,颜色为值http://blog.csdn.net/shuke1991/article/details/50462580

      x = np.arange(-2,2); y = np.arange(0,3)

          z,s = np.meshgrid(x,y)

      z  

      array([[-2, -1, 0, 1],
      [-2, -1, 0, 1],
      [-2, -1, 0, 1]])

      s  

      array([[0, 0, 0, 0],
      [1, 1, 1, 1],
      [2, 2, 2, 2]])

      plt.scatter(z,s)#如下图所示

  • 相关阅读:
    SQL SERVER导入Excel csv
    微信付款码扫码枪支付
    idftp
    不正常地定义参数对象。提供了不一致或不完整的信息
    sql 日志文件截断收缩
    sql server 新语法 收藏
    SQL SERVER 2019新功能
    SQL SERVER 死锁
    rad 10.2
    TXMLDocument 创建空值节点不要缩写
  • 原文地址:https://www.cnblogs.com/liuting1990/p/7782668.html
Copyright © 2011-2022 走看看