def make_statistics_tab(self, df):
     stats_df = pd.DataFrame({
         'Type': df.dtypes.replace('object', 'string'),
         'Count': df.count(),
         'Mean': df.mean(numeric_only=True),
         'StdDev': df.std(numeric_only=True),
         'Min': df.min(numeric_only=True),
         'Max': df.max(numeric_only=True),
     })
     w = DataFrameViewer(stats_df)
     w.setAutoFillBackground(True)
     return w
示例#2
0
    def __init__(self, df):

        super().__init__()

        df = df.copy()
        self.df = df

        # DataFrame tab
        self.dataframe_tab = DataFrameViewer(self.df)
        self.addTab(self.dataframe_tab, "DataFrame")

        # Statistics tab
        try:
            self.statistics_tab = self.make_statistics_tab(df)
            self.addTab(self.statistics_tab, "Statistics")
        except:
            traceback.print_exc()

        # Histogram tab
        try:
            if not (type(df.index) == pd.MultiIndex
                    or type(df.columns) == pd.MultiIndex):
                histogram_tab = self.make_histogram_tab(df)
                self.addTab(histogram_tab, "Histogram")
        except:
            traceback.print_exc()
    def __init__(self, df):

        super().__init__()

        df = df.copy()
        self.df = df

        # DataFrame tab
        self.dataframe_tab = DataFrameViewer(self.df)
        self.addTab(self.dataframe_tab, "DataFrame")

        # Statistics tab
        try:
            self.statistics_tab = self.make_statistics_tab(df)
            self.addTab(self.statistics_tab, "Statistics")
        except:
            traceback.print_exc()

        # Histogram tab
        graph_maker = GraphBuilder(df)
        self.addTab(graph_maker, "Grapher")
示例#4
0
    def __init__(self, df):

        super().__init__()

        df = df.copy()
        self.df = df

        # DataFrame tab
        self.dataframe_tab = DataFrameViewer(self.df)
        # JW: change from "DataFrame" -> "Data"
        self.addTab(self.dataframe_tab, "Data")

        # Statistics tab
        self.statistics_tab = self.make_statistics_tab(df)
        self.addTab(self.statistics_tab, "Statistics")

        # Histogram tab
        # JW: always show histogram
        # if not (type(df.index) == pd.MultiIndex or type(df.columns) == pd.MultiIndex):
        try:
            histogram_tab = self.make_histogram_tab(df)
            self.addTab(histogram_tab, "Histogram")
        except:
            pass