@TOC

引言

Anaconda环境下练习创建虚拟环境,在虚拟环境下安装 jupyter 和 numpy,并运行jupyter,完成numpy的不少于10道的基础练习,熟悉矩阵运算。

Anaconda安装

1、在官网上下载。

2、打开下载的文件。

jupyter 安装前ipython jupyter怎样安装numpy_jupyter 安装前ipython


然后,选择D盘或者E盘

jupyter 安装前ipython jupyter怎样安装numpy_jupyter 安装前ipython_02


然后把两个勾去掉

jupyter 安装前ipython jupyter怎样安装numpy_numpy_03


最后,点击Finish。

numpy的基础练习

首先,导入相关库

import numpy as np
import pandas as pd
from pandas import Series,DataFrame
import matplotlib.pyplot as plt
 
%matplotlib inline

1、查看版本

jupyter 安装前ipython jupyter怎样安装numpy_numpy_04


完成

2、创建一个长度为10的一维全为0的ndarray对象

jupyter 安装前ipython jupyter怎样安装numpy_图灵测试_05


3、让第5个元素等于1

jupyter 安装前ipython jupyter怎样安装numpy_numpy_06


4、创建一个元素为从10到49的ndarray对象

jupyter 安装前ipython jupyter怎样安装numpy_图灵测试_07


完成

5、使用np.random.random创建一个1010的ndarray对象

jupyter 安装前ipython jupyter怎样安装numpy_jupyter_08


6、打印出最大最小元素

jupyter 安装前ipython jupyter怎样安装numpy_python_09


7、创建一个10
10的ndarray对象,且矩阵边界全为1,里面全为0

jupyter 安装前ipython jupyter怎样安装numpy_jupyter_10


8、创建一个范围在(0,1)之间的长度为12的等差数列

jupyter 安装前ipython jupyter怎样安装numpy_numpy_11


9、创建一个长度为10的随机数组

jupyter 安装前ipython jupyter怎样安装numpy_jupyter 安装前ipython_12


10、排序

jupyter 安装前ipython jupyter怎样安装numpy_jupyter 安装前ipython_13

这里是教材里的例题

jupyter 安装前ipython jupyter怎样安装numpy_jupyter_14


jupyter 安装前ipython jupyter怎样安装numpy_jupyter 安装前ipython_15

三个库的例题

jupyter 安装前ipython jupyter怎样安装numpy_numpy_16


jupyter 安装前ipython jupyter怎样安装numpy_jupyter_17


jupyter 安装前ipython jupyter怎样安装numpy_python_18


jupyter 安装前ipython jupyter怎样安装numpy_numpy_19


jupyter 安装前ipython jupyter怎样安装numpy_图灵测试_20

图灵测试

图灵测试是测试人在与被测试者(一个人和一台机器)隔开的情况下,通过一些装置(如键盘)向被测试者随意提问。问过一些问题后,如果被测试者超过30%的答复不能使测试人确认出哪个是人、哪个是机器的回答,那么这台机器就通过了测试,并被认为具有人类智能。