From 1de191f3da32400e851bf3b7935513d6fd0379b2 Mon Sep 17 00:00:00 2001 From: Supermjork Date: Thu, 4 May 2023 14:29:39 +0300 Subject: [PATCH] Started on plotly graphs --- dwarves/digger.py | 1 - dwarves/engineer.py | 8 +++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dwarves/digger.py b/dwarves/digger.py index 5660c42..ba0dc9a 100644 --- a/dwarves/digger.py +++ b/dwarves/digger.py @@ -29,7 +29,6 @@ def slam_dunk(dataset, column, labels): max_value = dataset[column].max() print("min: ", min_value, " max: ", max_value) bins = np.linspace(min_value, max_value, len(labels) + 1) - bins dunked_column = "bin_" + column dataset[dunked_column] = pd.cut( diff --git a/dwarves/engineer.py b/dwarves/engineer.py index 3fd3f65..108039c 100644 --- a/dwarves/engineer.py +++ b/dwarves/engineer.py @@ -2,6 +2,7 @@ import matplotlib.pyplot as plt import seaborn as sns import pandas as pd +import plotly.express as exp import mining_hq from numpy import count_nonzero @@ -17,7 +18,8 @@ custom_params = {"axes.spines.right": False, "axes.spines.top": False} sns.set_theme(style = 'ticks', rc = custom_params) plt.xticks(rotation = 90) -games_fig_pre = sns.histplot(data = games_pre, x = "Year", palette = sns.color_palette("flare"), kde = True) +games_fig_pre = sns.histplot(data = games_pre, x = "Year", kde = True) +games_fig_pre.set_title('Game Sales Pre-2000') plt.show() plt.xticks(rotation = 90) @@ -60,3 +62,7 @@ plt.xticks(rotation = 90) games_crime_dur = sns.jointplot(data = games_dur, x = "Year", y = 'Violent_US') plt.close(1) plt.show() + +# Need to floor the years, shows trailing bars on the histogram :/ +test_fig = exp.histogram(games_dur, x = "Year") +test_fig.show()