jupyter notebook 上的交互式绘图

时间:2021-06-23 15:32:32

标签: python pandas plot jupyter-notebook interactive

我正在尝试获取交互式绘图,但此代码的输出完全为空。 如果我擦除 plt.show() 我得到这个输出 AxesSubplot: without the image

import numpy as np
import pandas as pd
xx=float('nan')
data=[['A', 1, xx ],
        ['B', 5,6],
        ['C', 4,6]
        ,['A', 6,xx],
        ['B',9,xx],
        ['C', 7,9]
        ,['A', 2,3],
        ['B', 5,1],
        ['C',2,10]
        ,['B', 8,2],
        ['B', 5,4],
        ['C', 8,5 ]]
dff = pd.DataFrame(data, columns=['x','y','z'])


import matplotlib.pyplot as plt
%matplotlib notebook

dff['y'].value_counts().plot(kind='bar')
plt.show()

0 个答案:

没有答案
相关问题