jupyter notebook 笔记

nbclassic 经典版

新版的 jupyter notebook 太丑了。 最难受的是字体太小了。

我还是喜欢老版本的 jupyter notebook.

安装经典版:

pip install nbclassic

启动经典版:

jupyter server

或是

jupyter nbclassic

参考来源: https://github.com/jupyter/nbclassic

jupyter notebook 设置黑色背景

  • pip install jupyterthemes

  • jt -l 列出

  • jt -h 帮助

  • jt -T -N 显示 toolbar 和文件名

  • jt -t monokai -T -N # 使用 sublime 风格

  • jt -t onedork -T -N # 使用 atom 主题

  • jt -r 重置默认主题

jt -t monokai -fs 115 -nfs 125 -tfs 115 -dfs 115 -ofs 115 -cursc r -cellw 80% -lineh 115 -altmd -kl -T -N

魔法命令

%%timeit,带 it, 把代码运行很多遍!! 会运行很久!!

%%time, 只运行一次。 对单元格的代码计算用时。

%timeit 一个百分号 %, 也是多次运行,很耗时!

注意一点, 不要使用 it !!!

  1. %lsmagic 查看一些内建的的快捷键。

    • 比如 %matplotlib inline
    • %%HTML 可以直接渲染 HTML代码,比如插入图片,视频
    • %%timeit -r 1 -n 1 单元格计时。
    • %timeit 单行计时。
  2. arr? max? 可以直观地查看数据类型,帮助文档,以及例子

  3. arr?? 可以阅读相关源码

安装

新建一个conda 环境后,需要安装 jupyter notebook 以及相关的插件

直接运行以下命令

python 复制代码
import os 

os.system("pip install jupyter notebook")
os.system("pip install jupyter_contrib_nbextensions")
os.system("jupyter contrib nbextension install --user")
os.system("pip install jupyter_nbextensions_configurator")

配置

  1. 修改自动保存文件的 【时间间隔】, 防止浏览器频繁闪烁。
    打开这个文件:
    C:\Users\Administrator.jupyter\jupyter_notebook_config.py

添加 R 环境

conda install r-essentials

conda install r r-essentials --channel

conda-forge conda install r- --channel conda-forge


老哥留步,支持一下。

相关推荐
PassLink_1 小时前
[Jupyter Notebook]:Jupyter Notebook 安装教程(代码编辑器)
ide·jupyter·编辑器·环境变量·python 安装·notebook 安装教程
名字不要太长 像我这样就好6 小时前
【iOS】OC源码阅读——alloc源码分析
笔记·学习·macos·ios·objective-c
xin007hoyo7 小时前
算法笔记.染色法判断二分图
数据结构·笔记·算法
大学生亨亨8 小时前
go语言八股文(五)
开发语言·笔记·golang
无敌小茶11 小时前
Linux学习笔记之动静态库
linux·笔记
DXM052111 小时前
牟乃夏《ArcGIS Engine地理信息系统开发教程》学习笔记3-地图基本操作与实战案例
开发语言·笔记·学习·arcgis·c#·ae·arcgis engine
Humbunklung13 小时前
PySide6 GUI 学习笔记——常用类及控件使用方法(常用类矩阵QRectF)
笔记·python·学习·pyqt
AAAA劝导tx15 小时前
List--链表
数据结构·c++·笔记·链表·list
愚润求学15 小时前
【Linux】进程优先级和进程切换
linux·运维·服务器·c++·笔记
愚润求学16 小时前
【专题四】前缀和(3)
开发语言·c++·笔记·leetcode·刷题·c++11