欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 健康 > 养生 > jupyter notebook 笔记

jupyter notebook 笔记

2024/10/23 13:32:34 来源:https://blog.csdn.net/waterHBO/article/details/143085500  浏览:    关键词: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 以及相关的插件

直接运行以下命令

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


老哥留步,支持一下。

请求支持

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com