美文网首页
vs code集成jupyter notebook

vs code集成jupyter notebook

作者: 慢手暗夜 | 来源:发表于2018-09-05 12:59 被阅读0次

安装相关的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,显示结果。

运行结果:

相关文章

网友评论

      本文标题:vs code集成jupyter notebook

      本文链接:https://www.haomeiwen.com/subject/vokawftx.html