Jupyter Notebook魔术命令

Jupyter Notebook是一个基于网页的交互式笔记本,支持运行多种编程语言。
Jupyter Notebook 的本质式一个Web应用程序,便于创建和共享文学化程序文档,支持实现代码,数学方程,可视化和markdown。用途包括:数据清理和转换,数值模拟,统计建模,机器学习等。

1、%timeit 检测任意python语句的执行时间

%timeit [x**3 for x in range(1000)]

在这里插入图片描述

2、%matplotlib inline 画图显示在页面

import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline

data = np.arange(20)
plt.plot(data**2)

在这里插入图片描述

3、%pwd 显示当前目录

%pwd

在这里插入图片描述

4、%run python文件

%run test_run.py

在这里插入图片描述
在这里插入图片描述

相关推荐

  1. linux配置jupyternotebook

    2024-05-04 06:30:01       30 阅读
  2. IPython 魔术命令:提升你的Python编程体验

    2024-05-04 06:30:01       28 阅读
  3. IPython的文件魔术:%%file命令全攻略

    2024-05-04 06:30:01       30 阅读
  4. vscode anaconda jupyternotebook R Python配置

    2024-05-04 06:30:01       27 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-05-04 06:30:01       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-05-04 06:30:01       106 阅读
  3. 在Django里面运行非项目文件

    2024-05-04 06:30:01       87 阅读
  4. Python语言-面向对象

    2024-05-04 06:30:01       96 阅读

热门阅读

  1. js请求封装ajax、统一响应

    2024-05-04 06:30:01       33 阅读
  2. mac 安装anaconda

    2024-05-04 06:30:01       30 阅读
  3. 嵌入式物联网系统软硬件基础知识大全(2)

    2024-05-04 06:30:01       33 阅读
  4. 【004_音频开发_基础篇_ALSA插件使用】

    2024-05-04 06:30:01       36 阅读
  5. 什么是gcc-arm-linux-gnueabihf?

    2024-05-04 06:30:01       31 阅读
  6. 39 死锁

    39 死锁

    2024-05-04 06:30:01      37 阅读