首页 > 解决方案 > 如何在 Google Colaboratory 中使用 IBM python 模块“pixiedust”?

问题描述

我对 IBM 开发的调试和可视化库 pixiedust 很着迷,想在 google colab 上试用一下。

我做了以下工作:

!pip install pixiedust

# matplotlib, seaborn, jinja2 are already installed in gcolab.

显示图表不起作用

import pixiedust
df = pixiedust.sampleData() # this shows the dataframe
display(df)  # This does not do anything.

调试也不起作用

import pixiedust

# Next cell
%%pixie_debugger
import random
def find_max (values):
    max = 0
    for val in values:
        if val > max:
            max = val
    return max
find_max(random.sample(range(100), 10))

# This gives nothing.

是否可以在 Google Colab 中使用 pixiedust,或者它只能在 IMB 云中使用?

标签: pythongoogle-colaboratorypixiedust

解决方案


@astro123 可能有点晚了,但也许其他人也和我一样。所以这是我的解决方案。如pixiedust 安装指南中所述,在https://pixiedust.github.io/pixiedust/install.html ,您必须检查您是否有一个带有 pixiedust 的 jupyter 内核。在 colab 中运行

!jupyter pixiedust list

如您所见,默认情况下它没有带有 pixiedust 的内核,只需通过以下方式安装即可

 `   !jupyter pixiedust install`

然后您可以在主面板上选择使用 pixiedust 内核运行。它现在应该可以工作了,但是随着协作的不断发展,没有简单的演练。

问候


推荐阅读