Jupyter Notebook魔术命令

Jupyter Notebook是一个基于网页的交互式笔记本,支持运行多种编程语言。

Jupyter Notebook 的本质式一个Web应用程序,便于创建和共享文学化程序文档,支持实现代码,数学方程,可视化和markdown。用途包括:数据清理和转换,数值模拟,统计建模,机器学习等。

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

python 复制代码
%timeit [x**3 for x in range(1000)]

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

python 复制代码
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline

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

3、%pwd 显示当前目录

python 复制代码
%pwd

4、%run python文件

python 复制代码
%run test_run.py


相关推荐
aqi0015 小时前
15天学会AI应用开发(七)有了大模型为什么还要引入RAG
人工智能·python·大模型·ai编程·ai应用
金銀銅鐵17 小时前
用 Python 实现 Take-Away 游戏
python·游戏
copyer_xyf17 小时前
Agent 流程编排
后端·python·agent
copyer_xyf18 小时前
Agent RAG
后端·python·agent
copyer_xyf18 小时前
【RAG】向量数据库:milvus
后端·python·agent
copyer_xyf18 小时前
Agent 记忆管理
后端·python·agent
星云穿梭1 天前
用Python写一个带图形界面的学生管理系统——完整教程
python
金銀銅鐵1 天前
用 Pygame 实现 15 puzzle
python·数学·游戏
黄忠2 天前
大模型之LangGraph技术体系
python·llm