Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if self.ref_y:
height = self.ref_y.height()
return QtCore.QSize(width, height)
# Examples
if __name__ == "__main__":
app = QtWidgets.QApplication(sys.argv)
from pandasgui.datasets import pokemon
# view = DataFrameViewer(pokemon)
# view.show()
view2 = DataFrameViewer(pokemon)
view2.show()
app.exec_()
def __init__(self, df, editable=True):
super().__init__()
self.df = df
self.editable = editable
# DataFrame tab
self.dataframe_tab = DataFrameViewer(self.df, editable=self.editable)
self.addTab(self.dataframe_tab, "DataFrame")
# Statistics tab
self.statistics_tab = self.make_statistics_tab(df)
self.addTab(self.statistics_tab, "Statistics")
# Grapher tab
graph_maker = Grapher(df)
self.addTab(graph_maker, "Grapher")
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, editable=self.editable)
w.setAutoFillBackground(True)
return w