首页  

jupyter 使用 技巧     所属分类 python 浏览量 28
查看 模块 方法 说明 
import numpy as np
np.var?

ddof 参数含义
Delta Degrees of Freedom
the divisor used in the calculation is N - ddof , 
N represents the number of elements. By default ddof is zero.


魔法命令

当前工作目录
%pwd
'/Users/dugang'


%run     运行Python脚本
%load    从脚本中加载代码并运行
%who     列出所有变量
%timeit  记录一行代码的执行时间
%debug   在异常处输入调试器
%matplotlib inline    在notebook中显示图形
%load_ext   加载扩展,例如IPython扩展
%pwd    输出当前工作目录
%ls     当前目录中的所有文件
%lsmagic   所有magic命令列表


执行另一个Jupyter notebook文件
%run ./hello.ipynb

从外部python脚本中插入代码
%load ./hello_world.py


运行Shell命令
!pwd
!ls 

显示执行时间
%timeit sum(range(1000))


测量整个单元格的执行时间

%%timeit
 
total = 0
for i in range(1000):
    total += i


隐藏不必要的输出
from matplotlib import pyplot as plt
x = range(1000)
y = [i**2 for i in x]
# 结尾加分号 ,不加分号 会额外显示 
# [< matplotlib.lines.Line2D at 0x15d9be090 >]
plt.plot(x,y);

上一篇     下一篇
Python统计学极简入门笔记 01 统计学简介

Python统计学极简入门笔记 02 描述性统计

Python统计学极简入门笔记 03 数据分布

matplotlib 技巧

matplot 基本用法

pandas matplot 读取日线数据,滚动计算bias250 添加阈值线