dfgui.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:PandasDataFrameGUI 作者: bluenote10 项目源码 文件源码
def redraw(self):
        column_index1 = self.combo_box1.GetSelection()
        if column_index1 != wx.NOT_FOUND and column_index1 != 0:
            # subtract one to remove the neutral selection index
            column_index1 -= 1

            df = self.df_list_ctrl.get_filtered_df()

            if len(df) > 0:
                self.axes.clear()

                column = df.iloc[:, column_index1]
                is_string_col = column.dtype == np.object and isinstance(column.values[0], str)
                if is_string_col:
                    value_counts = column.value_counts().sort_index()
                    value_counts.plot(kind='bar', ax=self.axes)
                else:
                    self.axes.hist(column.values, bins=100)

                self.canvas.draw()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号