根据提供的数据,我们可以从以下几个维度进行核心分析:
计算短视频引流占比和销售额相关性
import pandas as pd
# 假设数据已经存储在DataFrame df中,其中包含columns: '直播间ID', '短视频引流次数', '总销售金额'
correlation = df['短视频引流次数'].corr(df['总销售金额'])
print(f"相关性系数:{correlation}")
分析TOP3直播的引流人次占比
top_3_livestreams = df.sort_values(by='引流人次', ascending=False).head(3)
total_flow = df['引流人次'].sum()
top_3_flow_ratio = (top_3_livestreams['引流人次'].sum() / total_flow) * 100
print(f"TOP3直播的引流占比:{top_3_flow_ratio:.2f}%")
绘制带货类目分布图
import seaborn as sns
# 假设df中还有一个列'商品类别'
class_distribution = df.groupby('商品类别')['引流人次'].sum().reset_index()
plt.figure(figsize=(12, 8))
sns.barplot(x='商品类别', y='引流人次', data=class_distribution)
plt.title("带货类目与引流人数的关系")
plt.show()
计算人均引流数量
average_flow_per_follower = df['引流人次'] / df['粉丝数']
print(f"平均每位粉丝的引流次数:{average_flow_per_follower.mean():.2f}")
以上分析数据来源:互联岛