gpt4 book ai didi

python - vs 代码 Python 扩展数据框未显示在输出中

转载 作者:太空宇宙 更新时间:2023-11-04 06:40:29 25 4
gpt4 key购买 nike

我刚刚开始通过 Python 扩展在 Visual Studio Code 中使用 jupyter 单元格。它输出的图很好,但我的数据框没有像 blog example 那样显示来自微软。下面是我在 VS Code 中运行的代码:

#%%
import matplotlib.pyplot as plt
import matplotlib as mpl
import numpy as np
import pandas as pd

x = np.linspace(0, 20, 100)
plt.plot(x, np.sin(x))
plt.show()

#%%
d = {'col1': [1, 2], 'col2': [3, 4]}
df = pd.DataFrame(data=d)
df

我的输出看起来像这样:

VS Code Cell outputs

我很高兴在 VS Code 中使用 jupyter,但我需要像在其他变量浏览器中一样查看数据帧。

我在 Windows 上使用 Anaconda 作为我的环境。

  • jupyter=1.0.0=py36_7
  • jupyter_client=5.2.3=py36_0
  • jupyter_console=6.0.0=py36_0
  • jupyter_core=4.4.0=py36_0
  • numpy=1.15.4=py36h19fb1c0_0
  • Pandas =0.23.4=py36h830ac7b_0

最佳答案

我卸载了我的 Anaconda 3.6 并安装了更新的 Anaconda 3.7,现在它可以在 VS Code 中运行。

关于python - vs 代码 Python 扩展数据框未显示在输出中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54101454/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com