From 05a8dec3ac1b849709cb352680eb9c71e651c5ae Mon Sep 17 00:00:00 2001 From: KOSASIH Date: Sat, 11 May 2024 14:37:11 +0700 Subject: [PATCH] Create data_analysis.py --- data_science/data_analysis.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 data_science/data_analysis.py diff --git a/data_science/data_analysis.py b/data_science/data_analysis.py new file mode 100644 index 0000000..f7dced9 --- /dev/null +++ b/data_science/data_analysis.py @@ -0,0 +1,17 @@ +import pandas as pd +import scipy.stats as stats + +def analyze_data(data): + # Analyze data using Pandas or SciPy + # For example, calculate summary statistics, perform statistical tests, or fit distributions + + # Calculate summary statistics + summary_stats = data.describe() + + # Perform statistical tests + t_stat, p_val = stats.ttest_1samp(data['feature'], 0) + print(f'T-statistic: {t_stat:.3f}, p-value: {p_val:.3f}') + + # Fit distributions + param_estimates = stats.norm.fit(data['feature']) + print(f'Estimated parameters: {param_estimates}')