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


老哥留步,支持一下。

相关推荐
_落纸2 天前
三大基础无源电子元件——电阻(R)、电感(L)、电容(C)
笔记
Alice-YUE2 天前
【CSS学习笔记3】css特性
前端·css·笔记·html
2303_Alpha2 天前
SpringBoot
笔记·学习
Hello_Embed2 天前
STM32HAL 快速入门(二十):UART 中断改进 —— 环形缓冲区解决数据丢失
笔记·stm32·单片机·学习·嵌入式软件
咸甜适中2 天前
rust语言 (1.88) 学习笔记:客户端和服务器端同在一个项目中
笔记·学习·rust
Grassto2 天前
RAG 从入门到放弃?丐版 demo 实战笔记(go+python)
笔记
Magnetic_h2 天前
【iOS】设计模式复习
笔记·学习·ios·设计模式·objective-c·cocoa
周周记笔记2 天前
学习笔记:第一个Python程序
笔记·学习
丑小鸭是白天鹅2 天前
Kotlin协程详细笔记之切线程和挂起函数
开发语言·笔记·kotlin
潘达斯奈基~2 天前
《大数据之路1》笔记2:数据模型
大数据·笔记