Introduction to Machine learning NumPy

Source: Internet
Author: User

From numpy import * #导入numpy所有内容到当然命名空间下jj =[] #创建一个线性表jj. Append (1) #在线性表尾部添加变量jj. Append (' hat ') #线性表的数据类型可以是不同的kk ={}  #创建一个字典kk [' Dog ']= ' you ' #字典相当于cpp中的mapkk [1]=42 #数字和字符串可以作为keya =set ([1,2,2,2,3]) #创建一个集合b =set ([2,3,4])   A-B #得到集合a有 While collection B doesn't have something a|b  # AB's a&b  # AB intersection Aa=mat ([[[],        [3,4]]) #创建一个矩阵, similar to Matlabbb=array (() # To create a vector, note that the vector group is a different print shape (AA) than the matrix. T) #得到矩阵aa的行和列的个数,  . T is transpose Matrix eye (3)            #单位矩阵print bb**3<span style= "White-space:pre" ></span>  #向量对应位相乘print aa**2       # Aa*aaprint Multiply (AA,AA) #aa对应位相乘


I'll talk about that today.

Introduction to Machine learning NumPy

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.