R语言基础

匿名 (未验证) 提交于 2019-12-03 00:38:01
# encoding=utf-8 import numpy as np  l = [[1, 2, 3], [1, 3, 5]] type(l)  # list # np.arraynpl = np.array(l, dtype=np.int16)  # np.array,type(npl)  # np.arraynpl.shape  # npl.ndim  # 缁村害 npl.dtype  # npl.size  #  # np.zeros([3, 4])  # 0np.ones([3, 4])  # 1 # np.random.rand(2, 4)  # 2 X 4 np.random.rand()  # np.random.randint(1, 5, 5)  # 51~5 np.random.randn(1, 5)  # np.random.choice([10, 20, 30])  # np.random.beta(10, 20, 100)  # BETA1~10100 # npl = np.arange(1, 11).reshape([2, 5])  # 25np.exp(npl)  # e,nplnp.exp2(npl)  # 2,nplnp.sqrt(npl)  # np.sin(npl)  # sin np.log(npl)  # log  # list = np.array([[[1, 2, 3], [4, 5, 6, ]], [[7, 8, 9], [10, 11, 12]], [[13, 14, 15]]]) list.sum()  # list.sum(axis=0)  # axix list.max(axis=0)  #  # list1 = np.array([1, 2, 3, 4]) list2 = np.array([2, 3, 4, 5]) list1 + list2  # list1+―*/list1 list1 ** 2  # np.dot(list1.reshape([2, 2]), list2.reshape([2, 2]))  # dot np.concatenate((list1, list2))  # hstacknp.vstack((list1, list2))  # np.split(list1, 2)  # 

文章来源: R语言基础
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!