<aside> 📌 Task :

</aside>

- 장기 미접속자(6개월 이상)의 이탈사유와 전체 이탈 사유가 동일 할 것이다. 
=> 장기간 미접속 이유와 전기간 이탈사유가 다르다는 것은 그 문제가 결정적인 이탈사유라고 할 수 있을 것 같다. 

* 
- 독서에 시간 투자를 못하는 현대 사회인(20-50)들이 많을 것이다
=> 일반적인 사회인들의 근무 시간 9-6시에 접속수가 적을 것이다. 
=> 10대의 이용률이 높을 것이다.

 주말이 제일 완독률이 높을 것이다.
=> 주중/ 주말 완독률 비교 

<aside> 📌 실행 및 진행 사항 정리

</aside>

  1. 미접속 사용자 기준 정하기
# 1. 월 컬럼 생성
cleaned_df['month'] = cleaned_df['last_access_timestamp'].dt.month

# 2. 월별 접속자 수 집계
monthly_counts = cleaned_df['month'].value_counts().sort_index()

#출력
print("월별 접속자 수 ",monthly_counts)
  1. 6개월 이상 미접속 사용자 이탈 사유 대분류

total_inactive = len(inactive_users)
dropout_reason_counts_inactive = inactive_users['dropout_reason_category'].value_counts()
dropout_reason_ratio_inactive = (dropout_reason_counts_inactive / total_inactive * 100).round(1)

dropout_reason_inactive_df = pd.DataFrame({
    'dropout_reason_category': dropout_reason_counts_inactive.index,
    'count': dropout_reason_counts_inactive.values,
    'ratio (%)': dropout_reason_ratio_inactive.values
})

print("6개월 이상 미접속 사용자 이탈 사유 대분류 비율:")
print(dropout_reason_inactive_df)
  1. 전체 사용자 이탈 사유 대분류

total_users = len(cleaned_df)
dropout_reason_counts_all = cleaned_df['dropout_reason_category'].value_counts()
dropout_reason_ratio_all = (dropout_reason_counts_all / total_users * 100).round(1)

dropout_reason_all_df = pd.DataFrame({
    'dropout_reason_category': dropout_reason_counts_all.index,
    'count': dropout_reason_counts_all.values,
    'ratio (%)': dropout_reason_ratio_all.values
})

print("전체 사용자 이탈 사유 대분류:")
print(dropout_reason_all_df)