1\anaconda 和 python 安装
1.操作系统:win7,配置环境时需要联网。2.anaconda 安装
anaconda 下载地址:https://www.continuum.io/downloads/。根据电脑的操作
系统位数,选择下载 32 位和 64 位的 anaconda;
安装 anaconda 到 D:\anaconda 文件夹下。
3. 配置环境 python3.6
运行“开始\所有程序\anaconda3\Anaconda Prompt”,输入命令“conda create
--name py36 python=3”,出现“The following new packages will be installed”,输
入“y”,等待安装完成;
输入命令“activate py36”** python3.6。
4. 设置 jupyter notebook 工作路径
在环境变量中添加目录“D:\ anaconda\Scripts”。
运行 cmd,输入命令“jupyter notebook --generate-config”产生配置文件,配
置文件目录见 cmd 输出。
用记事本打开这个目录下的配置文件 jupyter_notebook_config.py,把其中一
行#c.NotebookApp.notebook_dir = ''替换成
c.NotebookApp.notebook_dir = r'C:\Users\GJB\Desktop'
(注意 C:\Users\GJB\Desktop 为本机的桌面目录)
5.安装 python
Python3.6 下载地址:https://www.python.org/downloads/release/python-362/。
64 位操作系统选择 Windows x86-64 executable installer,32 位操作系统选择
Windows x86 executable installer。下载后安装到 D:\python 文件夹下
2,jupyter 开发环境的使用
1,cmd输入jupyter notebook,进入jupyter,启动web页面服务
在windows桌面建立一个目录,作为jupyter的目录,将logisitic+regression.ipynb等文件拷贝到目录里,就可测试。
2,jupyter中的多行显示
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity ="all"
InteractiveShell.ast_node_interactivity ="all"
3,导入包
import re
import numpy as np
import pandas as pd
from pandas import Series
import re
import numpy as np
import pandas as pd
from pandas import Series
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"
import numpy as np
import numpy.random as randn
import numpy.linalg as la
import pandas as pd
import os
import matplotlib.pyplot as plt
from datetime import datetime
from sklearn import linear_model
%matplotlib inline