Update Fedora state: 2026-04-29 11:50
This commit is contained in:
parent
42ca768584
commit
10f0d5de1d
338 changed files with 18983 additions and 32 deletions
|
|
@ -0,0 +1 @@
|
|||
{"version":1,"resource":"file:///home/breadway/Documents/Year%2010/Year%2010/Psychology/run_and_verify.py","entries":[{"id":"qMUb.py","source":"Chat Edit: 'can you ensure the data shows an upward trend in happiness as the study goes on, and in direct correlation with the habits completed by that participant? at the moment, the intervention group is happier after a single day.'","timestamp":1774347459417}]}
|
||||
45
dot_config/private_Code/User/History/6b1c27e9/qMUb.py
Normal file
45
dot_config/private_Code/User/History/6b1c27e9/qMUb.py
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
#!/usr/bin/env python3
|
||||
"""Generate new data and display sample showing upward trend"""
|
||||
import subprocess
|
||||
import pandas as pd
|
||||
|
||||
# Run data generator
|
||||
result = subprocess.run(['python3', 'Data Gen.py'], capture_output=True, text=True)
|
||||
print(result.stdout)
|
||||
if result.stderr:
|
||||
print("Errors:", result.stderr)
|
||||
|
||||
# Load and display trend analysis
|
||||
df = pd.read_csv('organization_happiness_study_data.csv')
|
||||
df['Habits_Count'] = (
|
||||
(df['Calendar_Adherence'] == 'Yes').astype(int) +
|
||||
(df['Cleanliness_Adherence'] == 'Yes').astype(int) +
|
||||
(df['Punctuality_Adherence'] == 'Yes').astype(int)
|
||||
)
|
||||
|
||||
intervention = df[df['Group'] == 'Intervention']
|
||||
control = df[df['Group'] == 'Control']
|
||||
|
||||
print("\n" + "="*70)
|
||||
print("UPWARD TREND ANALYSIS")
|
||||
print("="*70)
|
||||
|
||||
print("\n[INTERVENTION GROUP] - Should show upward trend")
|
||||
early_int = intervention[intervention['Day'] <= 7]
|
||||
late_int = intervention[intervention['Day'] >= 24]
|
||||
print(f"Days 1-7: Avg Happiness = {early_int['Happiness'].mean():.2f}")
|
||||
print(f"Days 24-30: Avg Happiness = {late_int['Happiness'].mean():.2f}")
|
||||
print(f"GROWTH: +{late_int['Happiness'].mean() - early_int['Happiness'].mean():.2f} points\n")
|
||||
|
||||
print("[CONTROL GROUP] - Should show flat/random pattern")
|
||||
early_ctl = control[control['Day'] <= 7]
|
||||
late_ctl = control[control['Day'] >= 24]
|
||||
print(f"Days 1-7: Avg Happiness = {early_ctl['Happiness'].mean():.2f}")
|
||||
print(f"Days 24-30: Avg Happiness = {late_ctl['Happiness'].mean():.2f}")
|
||||
print(f"CHANGE: {late_ctl['Happiness'].mean() - early_ctl['Happiness'].mean():+.2f} points\n")
|
||||
|
||||
print("[HABIT CORRELATION] - More habits = Higher happiness")
|
||||
for habits in range(4):
|
||||
subset = intervention[intervention['Habits_Count'] == habits]
|
||||
if len(subset) > 0:
|
||||
print(f"{habits} habits/day: Avg Happiness = {subset['Happiness'].mean():.2f} ({len(subset)} observations)")
|
||||
Loading…
Add table
Add a link
Reference in a new issue