Releases: pralinkhaira/Data-Visualization-Dashboard
Data-Visualization-Dashboard-V1.1
The code updates can be summarized as follows:
- Modularize the code by separating it into three files:
data_loader.py
for data loading,visualization_creator.py
for visualization creation, anddashboard_layout.py
for dashboard layout. - Use a configuration file (
config.py
) to store file paths and other settings. - Implement error handling in
data_loader.py
to handle potential errors like file not found or data format issues. - Optimize data loading by reading data in chunks using the
chunksize
parameter inpd.read_csv()
.
Note:
Code for data_loader.py is combination of three part of codes which provides a flexible data loading function that incorporates error handling and supports chunked reading. It includes three main options:
Option 1: pd.read_csv(file_path)
-Loads the entire CSV file into memory and returns a DataFrame.
-Suitable for small to medium-sized datasets that fit into memory.
Option 2: pd.read_csv(file_path, chunksize=10000)
-Reads the data in chunks of 10,000 rows.
-Suitable for large datasets that may not fit into memory all at once.
-Enables memory-efficient processing and performance optimization.
Option 3: pd.read_csv(file_path) with error handling
-Catches FileNotFoundError and ParserError exceptions.
-Raises custom exceptions with informative error messages.
-Suitable for handling file-related issues or data format problems gracefully.
These changes improve code organization, enhance reusability, provide better error handling, and optimize data loading for larger datasets.