|
import pandas as pd
|
|
from datetime import datetime
|
|
|
|
|
|
file_path = r"C:\Users\user\Desktop\git\asmr_title\asmr_data.csv"
|
|
|
|
|
|
exclude_words = ["実演", "まとめ", "日文版", "中英日", "パック", "セット", "实演", "中日英", "実録", "ブルーアーカイブ", "アズールレーン", "日语"]
|
|
|
|
|
|
exclude_tags = ["ノンフィクション", "体験談", "東方Project", "特定タグ2"]
|
|
|
|
|
|
df = pd.read_csv(file_path)
|
|
|
|
|
|
title_pattern = '|'.join(exclude_words)
|
|
df = df[~df['Title'].str.contains(title_pattern, case=False, na=False)]
|
|
|
|
|
|
tag_pattern = '|'.join(exclude_tags)
|
|
df = df[~df['Tags'].str.contains(tag_pattern, case=False, na=False)]
|
|
|
|
|
|
today = datetime.now()
|
|
|
|
|
|
df['Date'] = pd.to_datetime(df['Date'], errors='coerce')
|
|
|
|
|
|
df['Days_Since_Sale'] = (today - df['Date']).dt.days
|
|
|
|
|
|
df['Sales_Per_Day'] = df['Sales'] / df['Days_Since_Sale']
|
|
|
|
|
|
df['Revenue_Per_Day'] = (df['Sales'] * df['Price']) / df['Days_Since_Sale']
|
|
|
|
|
|
df = df[df['Revenue_Per_Day'] > 500]
|
|
|
|
|
|
sorted_df = df.sort_values(by='Revenue_Per_Day', ascending=False)
|
|
|
|
|
|
sorted_df.to_csv(r"C:\Users\user\Desktop\git\asmr_title\sorted_asmr_data.csv", index=False)
|
|
|
|
|
|
print(sorted_df[['Title', 'Sales', 'Price', 'Date', 'Days_Since_Sale', 'Revenue_Per_Day']].head())
|
|
|