安装相关的python库
pip install jupyter
pip install pandas # this will include numpy lib
pip install matplotlib
安装visual studio code插件
python插件
jupyter插件
简单示例
# %%
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
ts = pd.Series(np.random.randn(1000), index=pd.date_range('1/1/2000', periods=1000))
ts = ts.cumsum()
ts.plot()
在代码中插入#%%,会在vs code中显示如下的Run cell按钮。点击Run cell,便会启动jupyter notebook,显示结果。
运行结果:
网友评论