From 7fb3d57342c23ec21c3c357fa85d4d63d068e8a6 Mon Sep 17 00:00:00 2001 From: KOSASIH Date: Fri, 10 May 2024 19:41:29 +0700 Subject: [PATCH] Create data_visualization.py --- data_analytics/data_visualization.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 data_analytics/data_visualization.py diff --git a/data_analytics/data_visualization.py b/data_analytics/data_visualization.py new file mode 100644 index 000000000..96414dd96 --- /dev/null +++ b/data_analytics/data_visualization.py @@ -0,0 +1,16 @@ +import plotly.express as px + +class DataVisualization: + def __init__(self, data): + self.data = data + + def visualize_data(self): + # Create interactive dashboards + fig = px.scatter(self.data, x='amount', y='frequency', color='cluster') + fig.show() + + fig = px.histogram(self.data, x='transaction_type', nbins=20) + fig.show() + + fig = px.box(self.data, x='cluster', y='amount') + fig.show()