Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: format code with Autopep8, Black, ClangFormat, dotnet-format, Go fmt, Gofumpt, Google Java Format, isort, Ktlint, PHP CS Fixer, Prettier, RuboCop, Ruff Formatter, Rustfmt, Scalafmt, StandardJS, StandardRB, swift-format and Yapf #16

Merged
merged 1 commit into from
May 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions models/data_processing/data_analytics.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Import necessary libraries
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns

# Define a class for data analysis and visualization


class DataAnalytics:
def __init__(self, data_path):
# Load data from file
Expand All @@ -17,7 +19,7 @@ def summary_statistics(self):
def correlation_matrix(self):
# Compute the correlation matrix for the data
corr = self.data.corr()
sns.heatmap(corr, annot=True, cmap='coolwarm')
sns.heatmap(corr, annot=True, cmap="coolwarm")
plt.show()

def scatter_plot(self, x_column, y_column):
Expand All @@ -29,21 +31,21 @@ def scatter_plot(self, x_column, y_column):

def bar_plot(self, column):
# Create a bar plot for a column of the data
self.data[column].value_counts().plot(kind='bar')
self.data[column].value_counts().plot(kind="bar")
plt.xlabel(column)
plt.ylabel('Count')
plt.ylabel("Count")
plt.show()

def line_plot(self, column):
# Create a line plot for a column of the data
plt.plot(self.data[column])
plt.xlabel('Index')
plt.xlabel("Index")
plt.ylabel(column)
plt.show()

def histogram_plot(self, column):
# Create a histogram plot for a column of the data
plt.hist(self.data[column])
plt.xlabel(column)
plt.ylabel('Count')
plt.ylabel("Count")
plt.show()
Loading