Skip to main content

The `DataFrame Statistical Analyzer` package provides a utility tool for statistical analyzing in a Pandas DataFrame.

Project description

DataFrame Statistical Analyzer Utility

The DataFrameAnalyzer project provides a robust and extensible tool for analyzing and visualizing data stored in a Pandas DataFrame. The tool encapsulates various data analysis functionalities, including summary statistics, percentage change computation, outlier detection, trend analysis, moving average calculation, correlation analysis, and seasonal pattern interpretation. The project is designed following the SOLID principles and incorporates design patterns to ensure maintainability and ease of use.

Features

  • Summary Statistics: Statistical summary of the DataFrame.
  • Month-to-Month Percentage Changes: Percentage changes between consecutive months.
  • Outliers Detection (Z-score > 3): DataFrame segments identified as outliers based on Z-score.
  • Outliers Detection (MAD): DataFrame segments identified as outliers based on Median Absolute Deviation.
  • Trend Analysis (Linear Regression): Slope and intercept of linear trends for numeric columns.
  • Moving Average (3 months window): Moving average values for numeric columns over a 3-month window.
  • Calculating DIPS: DataFrame segments identified as dips below certain thresholds.
  • Calculating Increases: DataFrame segments identified as increases above certain thresholds.
  • Seasonal Patterns: Monthly seasonal patterns identified using Holt-Winters exponential smoothing.
  • Correlation Analysis: Correlation matrix between numeric columns.

Installation

  1. Install the package:
    pip install dataframe-statistical-analyzer
    

Usage

  1. Import the necessary modules:

    import pandas as pd
    from dataframe_statistical_analyzer import DataFrameAnalyzer
    
  2. Prepare your DataFrame:

    data = {
        "month": ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
        "stock_price": [50.0, 51.5, 49.8, 52.0, 53.2, 54.0, 55.0, 56.0, 57.5, 59.0, 60.0, 61.0]
    }
    
    df = pd.DataFrame(data)
    
  3. Initialize the DataFrameAnalyzer with the DataFrame:

    analyzer = DataFrameAnalyzer(df)
    
  4. Perform the analysis:

    analyzer.analyze()
    
  5. Expected Outputs When you run the analyze() method of DataFrameAnalyzer, you can expect to see the following outputs:

  • Summary Statistics: Statistical summary of the DataFrame.
  • Month-to-Month Percentage Changes: Percentage changes between consecutive months.
  • Outliers Detection (Z-score > 3): DataFrame segments identified as outliers based on Z-score.
  • Outliers Detection (MAD): DataFrame segments identified as outliers based on Median Absolute Deviation.
  • Trend Analysis (Linear Regression): Slope and intercept of linear trends for numeric columns.
  • Moving Average (3 months window): Moving average values for numeric columns over a 3-month window.
  • Calculating DIPS: DataFrame segments identified as dips below certain thresholds.
  • Calculating Increases: DataFrame segments identified as increases above certain thresholds.
  • Seasonal Patterns: Monthly seasonal patterns identified using Holt-Winters exponential smoothing.
  • Correlation Analysis: Correlation matrix between numeric columns.

Contributing

We welcome contributions to the DataFrameAnalyzer project. Please fork the repository and submit a pull request with your changes. Ensure your code adheres to the existing style and includes appropriate tests.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Acknowledgments

This project utilizes several open-source libraries, including Pandas, Matplotlib, Scipy, Scikit-learn, and Statsmodels. We thank the developers and maintainers of these libraries for their invaluable contributions to the open-source community.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dataframe_statistical_analyzer-0.1.2.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file dataframe_statistical_analyzer-0.1.2.tar.gz.

File metadata

File hashes

Hashes for dataframe_statistical_analyzer-0.1.2.tar.gz
Algorithm Hash digest
SHA256 609ba052387677ca26817ee9dc3251d3dc54d916259ac38645f358185780876a
MD5 003054ece72a649e74cffb37cc321509
BLAKE2b-256 753b8f7bb97e1bc025e1c962f8624538ad38787efc2736dd9fa21992c2f122c9

See more details on using hashes here.

File details

Details for the file dataframe_statistical_analyzer-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for dataframe_statistical_analyzer-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 75b6a2c03ad37bccd86cfb78efe2b76dc63a9687bb4fa7d16b746b15c875fea0
MD5 2b8502e4c8927233c51c43fa073d38a4
BLAKE2b-256 9c3505fc0240a2c1c49be933db961393bbe10a1e2c3f75363e7f9145609aeb42

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page