{"id":15132674,"url":"https://github.com/quantum-software-development/statistical-measures","last_synced_at":"2025-04-12T14:21:45.766Z","repository":{"id":256495075,"uuid":"855485060","full_name":"Quantum-Software-Development/statistical-measures","owner":"Quantum-Software-Development","description":"This repository contains a statistical analysis of customer service ratings for Biscobis Ltd","archived":false,"fork":false,"pushed_at":"2025-04-07T08:42:45.000Z","size":11602,"stargazers_count":1,"open_issues_count":4,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-12T11:47:19.836Z","etag":null,"topics":["machine-learning","mathematics","mathp","mathplotlib","measurements","numpy","pandas","puthon3","seaborn","statisctics"],"latest_commit_sha":null,"homepage":"https://github.com/Quantum-Software-Development/calculate-statistical-measures","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Quantum-Software-Development.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"Quantum-Software-Developmen","Custom":"https://github.com/sponsors/Quantum-Software-Development/card"}},"created_at":"2024-09-11T00:14:29.000Z","updated_at":"2025-03-30T16:04:20.000Z","dependencies_parsed_at":"2024-09-11T08:03:35.866Z","dependency_job_id":"62bf3c59-f429-4cff-8317-f69bb3786674","html_url":"https://github.com/Quantum-Software-Development/statistical-measures","commit_stats":{"total_commits":104,"total_committers":3,"mean_commits":"34.666666666666664","dds":"0.42307692307692313","last_synced_commit":"f35f984acacf786e3c46160b112b1db751103c70"},"previous_names":["quantum-software-development/calculate-statistical0-measures","quantum-software-development/calculate-statistical-measures"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quantum-Software-Development%2Fstatistical-measures","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quantum-Software-Development%2Fstatistical-measures/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quantum-Software-Development%2Fstatistical-measures/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quantum-Software-Development%2Fstatistical-measures/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Quantum-Software-Development","download_url":"https://codeload.github.com/Quantum-Software-Development/statistical-measures/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248578874,"owners_count":21127714,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["machine-learning","mathematics","mathp","mathplotlib","measurements","numpy","pandas","puthon3","seaborn","statisctics"],"created_at":"2024-09-26T04:22:16.057Z","updated_at":"2025-04-12T14:21:45.745Z","avatar_url":"https://github.com/Quantum-Software-Development.png","language":"Shell","readme":"\u003cbr\u003e\u003cbr\u003e\n\n## ✍️ Statistical Measures and [Bovespa Banks Value Analysis](https://github.com/Quantum-Software-Development/Bovespa-Banks-Value-Analysis)  : Calculation in Excel and Python for Data Science\n### \u003cp align=\"center\"\u003e [University of Data Science and Artificial Intelligence]() - PUC-SP - 2nd Semester/2024\n\n \n\n\u003cbr\u003e  \n\n\u003c!-- video presentation --\u003e\n\n#####  📺 For better resolution, watch the video on [YouTube.](https://youtu.be/_ytC6S4oDbM)\n\nhttps://github.com/user-attachments/assets/a5be1c12-73c1-4515-869b-9adf116f1d73\n\n##### 🎶 Prelude Suite no.1 (J. S. Bach) - [Sound Design Remix]()\n\n\n\u003cbr\u003e\n\n\n## Introduction\n\nWelcome to the \"Comprehensive Statistical Analysis of Biscobis Dataset\" repository. This repository aims to conduct a detailed statistical analysis of the biscobis-statistical-measures.csv dataset, covering various measures such as mean, median, mode, minimum, maximum, range, variance, standard deviation, and coefficient of variation.\n\n## Project Overview\n\nThis repository presents a statistical analysis of customer service ratings for Biscobis Ltd., based on a survey of 100 customers who evaluated seven different aspects of the company's services.\n\n## Setup\nTo use this repository, ensure you have Python installed on your system along with the Pandas and NumPy libraries. Clone this repository and place your biscobis-statistical-measures.csv file in the root directory.\n\n\n\n## Dataset \n\n### [Click here to download the dataset](dataset/bicobbis-statistical-measures.csv)\n\nThe dataset `biscobis-statistical-measures.csv` contains customer ratings for the following categories:\n\n1. Shipping speed\n2. Price level\n3. Negotiation flexibility\n4. Image\n5. Services provided\n6. Sales force\n7. Product quality\n\n## Python Code for Statistical Analysis\n\nThis project provides three Python scripts for analyzing Biscobis customer service data: a concise version for quick analysis, a comprehensive script for calculating statistical measures, and a detailed version for in-depth insights..\n\n\n## Concise Python Code for Quick Analysis\n\nThis concise code quickly calculates and outputs the main statistical measures and is perfect for quick analyses or when you need a rapid overview of the data's statistical properties.\n\n```python\nimport pandas as pd\n\n# Load the dataset\ndata = pd.read_csv('biscobis-statistical-measures.csv', skiprows=2, encoding='latin1')\n\n# Calculate statistical measures\nstatistics = data.describe().T\nstatistics['mode'] = data.mode().iloc[0]\nstatistics['coefficient_of_variation'] = (statistics['std'] / statistics['mean']) * 100\n\n# Save the results to a CSV file\nstatistics.to_csv('statistical_measures.csv')\n\nprint(statistics)\n```\n\n### Comprehensive Python Code for Calculating Statistical Measures\n\nHere is the Python script to calculate a comprehensive set of statistical measures:\n\n\n```python\nimport pandas as pd\n\n# Load the dataset\ndata = pd.read_csv('biscobis-statistical-measures.csv')\n\n# Calculate comprehensive statistics\nstats = {\n    \"Mean\": data.mean(),\n    \"Median\": data.median(),\n    \"Q1\": data.quantile(0.25),\n    \"Q2\": data.quantile(0.50),\n    \"Q3\": data.quantile(0.75),\n    \"Mode\": data.mode().iloc[0],  # Simplified mode; first mode only\n    \"Minimum\": data.min(),\n    \"Maximum\": data.max(),\n    \"Range\": data.max() - data.min(),\n    \"Variance\": data.var(),\n    \"Standard Deviation\": data.std(),\n    \"Coefficient of Variation\": data.std() / data.mean()\n}\nstats_df = pd.DataFrame(stats)\n\n# Format the results for easy Excel import\nformatted_stats = stats_df.applymap(lambda x: f\"{x:.2f}\")\nformatted_stats.to_csv('formatted_statistical_data.csv', index=True)\nprint(formatted_stats)\n```\n\n\n### Comprehensive Python Code for Detailed Analysis\n\nThis comprehensive code provides detailed statistics and creates visualizations for deeper insights.\n\n```python\nimport pandas as pd\nimport numpy as np\nfrom scipy import stats\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\ndef calculate_statistics(data):\n    return pd.Series({\n        'Mean': np.mean(data),\n        'Median': np.median(data),\n        'Mode': stats.mode(data)[0][0],\n        'Standard Deviation': np.std(data),\n        'Variance': np.var(data),\n        'Range': np.ptp(data),\n        'Minimum': np.min(data),\n        'Maximum': np.max(data),\n        'Q1': np.percentile(data, 25),\n        'Q3': np.percentile(data, 75),\n        'Skewness': stats.skew(data),\n        'Kurtosis': stats.kurtosis(data),\n        'Coefficient of Variation': (np.std(data) / np.mean(data)) * 100\n    })\n\n# Load the dataset\ndf = pd.read_csv('biscobis-statistical-measures.csv', skiprows=2, encoding='latin1')\n\n# Calculate statistics for each column\nstatistics = df.apply(calculate_statistics)\n\n# Transpose the results for better readability\nstatistics_transposed = statistics.transpose()\n\n# Display and save the results\nprint(statistics_transposed)\nstatistics_transposed.to_csv('biscobis_detailed_statistics.csv')\n\n# Create visualizations\nplt.figure(figsize=(12, 6))\nsns.boxplot(data=df)\nplt.title('Distribution of Ratings by Category')\nplt.xticks(rotation=45)\nplt.tight_layout()\nplt.savefig('boxplot_biscobis.png')\nplt.close()\n\nplt.figure(figsize=(10, 8))\nsns.heatmap(df.corr(), annot=True, cmap='coolwarm')\nplt.title('Correlation Heatmap of Categories')\nplt.tight_layout()\nplt.savefig('heatmap_correlation_biscobis.png')\nplt.close()\n\ndef create_histogram(data, column, bins=10):\n    plt.figure(figsize=(8, 6))\n    sns.histplot(data[column], bins=bins, kde=True)\n    plt.title(f'Distribution of {column}')\n    plt.xlabel('Value')\n    plt.ylabel('Frequency')\n    plt.savefig(f'histogram_{column.lower().replace(\" \", \"_\")}.png')\n    plt.close()\n\nfor column in df.columns:\n    create_histogram(df, column)\n\nprint(\"Analysis complete. Results saved in CSV and PNG files.\")\n```\n\n```python\nimport pandas as pd\nimport numpy as np\nfrom scipy import stats\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\ndef calculate_statistics(data):\n    # [Previous statistics calculation remains the same]\n\n# Load the dataset\ndf = pd.read_csv('biscobis-statistical-measures.csv', skiprows=2, encoding='latin1')\n\n# Calculate statistics for each column\nstatistics = df.apply(calculate_statistics)\n\n# Transpose the results for better readability\nstatistics_transposed = statistics.transpose()\n\n# Display and save the results\nprint(statistics_transposed)\nstatistics_transposed.to_csv('biscobis_detailed_statistics.csv')\n\n# Create visualizations\nplt.figure(figsize=(12, 6))\nsns.boxplot(data=df)\nplt.title('Distribution of Ratings by Category')\nplt.xticks(rotation=45)\nplt.tight_layout()\nplt.savefig('boxplot_biscobis.png')\nplt.show()  # Added to display the boxplot\nplt.close()\n\nplt.figure(figsize=(10, 8))\nsns.heatmap(df.corr(), annot=True, cmap='coolwarm')\nplt.title('Correlation Heatmap of Categories')\nplt.tight_layout()\nplt.savefig('heatmap_correlation_biscobis.png')\nplt.show()  # Added to display the heatmap\nplt.close()\n\ndef create_histogram(data, column, bins=10):\n    plt.figure(figsize=(8, 6))\n    sns.histplot(data[column], bins=bins, kde=True)\n    plt.title(f'Distribution of {column}')\n    plt.xlabel('Value')\n    plt.ylabel('Frequency')\n    plt.savefig(f'histogram_{column.lower().replace(\" \", \"_\")}.png')\n    plt.show()  # Added to display each histogram\n    plt.close()\n\nfor column in df.columns:\n    create_histogram(df, column)\n\nprint(\"Analysis complete. Results saved in CSV and PNG files.\")\n```\n\n## Running the Analysis\n\nTo run either version of the code, follow these steps:\n1. Ensure you have Python installed on your system.\n2. Install the required libraries:\n   - For the concise version: `pip install pandas`\n   - For the comprehensive version: `pip install pandas numpy scipy matplotlib seaborn`\n3. Place the `biscobis-statistical-measures.csv` file in the same directory as the Python script.\n4. Run the script using Python.\n\n\n## Note on Displaying Graphs\n\nWhen running the comprehensive analysis script, you will now see the graphs displayed on your screen in addition to having them saved as PNG files. If you're running the script in a non-interactive environment (like a server or automated pipeline), you may want to comment out the plt.show() lines to prevent the script from hanging.\n\n#\n\n###### \u003cp align=\"center\"\u003e [Copyright 2024 Quantum Software Development. Code released under the MIT license.](https://github.com/Quantum-Software-Development/README/blob/161b677c5a791f0ca8219b8e934f1cf353d5b85d/LICENSE)\n\n\n\n\n\n\n\n","funding_links":["https://github.com/sponsors/Quantum-Software-Developmen","https://github.com/sponsors/Quantum-Software-Development/card"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquantum-software-development%2Fstatistical-measures","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquantum-software-development%2Fstatistical-measures","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquantum-software-development%2Fstatistical-measures/lists"}