正确打开方式:
cmd中先输入activate再输入jupyter notebook
否则有如下报错:
输入以上指令后会弹出jupyter的页面,new敲代码就好啦
这里可以保存为各种文件
保存为pdf需要下载一堆永远下不完的文件,直接Ctrl+P选择pdf就可以啦
jupyter找不到已安装的module
在jupyter notebook中执行以下代码:
import pip
def install(package):
pip.main(['install', package])
install('模块名称')
jupyter显示中文:
import matplotlib.pyplot as plt
plt.rcParams['font.sans-serif'] = [u'SimHei']
plt.rcParams['axes.unicode_minus'] = False
报错:UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xd0 in position 0: invalid continuation byte
将r=open(‘文件路径’,“r”,encoding=“utf-8”)改为
r=open(‘文件路径’,“r”,encoding=“ISO-8859-1”)
运行单元格:
1、shift+回车
2、运行按钮