您当前的位置: 首页 >  Python

段智华

暂无认证

  • 0浏览

    0关注

    1232博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

anaconda 和 python 安装;jupyter 开发环境的使用

段智华 发布时间:2017-08-03 13:18:12 ,浏览量:0

 

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"
3,导入包 import re import numpy as np import pandas as pd from pandas import Series

from IPython.core.interactiveshell import InteractiveShellInteractiveShell.ast_node_interactivity = "all"import numpy as npimport numpy.random as randnimport numpy.linalg as laimport pandas as pdimport osimport matplotlib.pyplot as pltfrom datetime import datetimefrom sklearn import linear_model%matplotlib inline

 
关注
打赏
1659361485
查看更多评论
立即登录/注册

微信扫码登录

0.1846s