dfgui.py 文件源码

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

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

            # It looks like using pandas dataframe.plot causes something weird to
            # crash in wx internally. Therefore we use plain axes.plot functionality.
            # column_name1 = self.columns[column_index1]
            # column_name2 = self.columns[column_index2]
            # df.plot(kind='scatter', x=column_name1, y=column_name2)

            if len(df) > 0:
                self.axes.clear()
                self.axes.plot(df.iloc[:, column_index1].values, df.iloc[:, column_index2].values, 'o', clip_on=False)

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


问题


面经


文章

微信
公众号

扫码关注公众号