Create Pandas Data Explorer Class
- Dominant language
- Python
- Stars
- 2
- Forks
- 0
- Avg merge
- 1m
- Merged PRs (30d)
- 1
Description
The current data exploration class is not good use pandas data profiler instead
import pandas as pd
from pandas_profiling import ProfileReport
class DataProfiler:
def __init__(self, dataframe):
"""
Initialize the DataProfiler with a Pandas DataFrame.
:param dataframe: Pandas DataFrame to profile.
"""
self.dataframe = dataframe
def generate_report(self, output_file=None):
"""
Generate a profile report of the DataFrame.
:param output_file: Optional file path to save the report as an HTML file.
:return: ProfileReport object.
"""
try:
profile = ProfileReport(self.dataframe, explorative=True)
if output_file:
profile.to_file(output_file)
return profile
except Exception as e:
print(f"Error generating report: {e}")
def set_dataframe(self, dataframe):
"""
Set a new DataFrame for profiling.
:param dataframe: Pandas DataFrame to profile.
"""
self.dataframe = dataframe
def get_dataframe(self):
"""
Get the current DataFrame being profiled.
:return: Pandas DataFrame.
"""
return self.dataframe
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.