【数据可视化-46】截止2025年手机发布数据可视化分析

🧑 博主简介:曾任某智慧城市类企业算法总监,目前在美国市场的物流公司从事高级算法工程师一职,深耕人工智能领域,精通python数据挖掘、可视化、机器学习等,发表过AI相关的专利并多次在AI类比赛中获奖。CSDN人工智能领域的优质创作者,提供AI相关的技术咨询、项目开发和个性化解决方案等服务,如有需要请站内私信或者联系任意文章底部的的VX名片(ID:xf982831907

💬 博主粉丝群介绍:① 群内初中生、高中生、本科生、研究生、博士生遍布,可互相学习,交流困惑。② 热榜top10的常客也在群里,也有数不清的万粉大佬,可以交流写作技巧,上榜经验,涨粉秘籍。③ 群内也有职场精英,大厂大佬,可交流技术、面试、找工作的经验。④ 进群免费赠送写作秘籍一份,助你由写作小白晋升为创作大佬。⑤ 进群赠送CSDN评论防封脚本,送真活跃粉丝,助你提升文章热度。有兴趣的加文末联系方式,备注自己的CSDN昵称,拉你进群,互相学习共同进步。

在这里插入图片描述

【数据可视化-46】截止2025年手机发布数据可视化分析

    • 一、引言
    • 二、数据探索
      • 2.1 数据集介绍
      • 2.2 数据清洗探索
    • 三、单维度特征可视化
      • 3.1 品牌分布
      • 3.2 推出年份分布
      • 3.3 RAM分布
      • 3.4 前置摄像头像素分布
      • 3.5 后置摄像头像素分布
      • 3.6 电池容量分布
      • 3.7 屏幕尺寸分布
    • 四、各个特征与价格关系的可视化
      • 4.1 品牌与价格关系
      • 4.2 RAM与价格关系
      • 4.3 前置摄像头像素与价格关系
      • 4.4 后置摄像头像素与价格关系
      • 4.5 电池容量与价格关系
      • 4.6 屏幕尺寸与价格关系
      • 4.7 多维度组合分析(品牌、RAM与价格)

一、引言

  在当今数字化时代,智能手机已成为人们生活中不可或缺的一部分。随着技术的不断进步,智能手机市场呈现出多样化的发展趋势。本文将利用智能手机数据集,从多个维度进行可视化分析,深入探讨不同品牌、型号及硬件配置对价格的影响,揭示智能手机市场的定价规律和消费者偏好。该数据集涵盖了不同品牌的手机型号及其详细规格,包括RAM、摄像头像素、电池容量等关键特征,并提供了多个国家和地区的官方发布价格。以下分析将使用Seaborn库实现,提供完整的代码示例,以供读者参考和复现。

二、数据探索

2.1 数据集介绍

  关于 Dataset该数据集包含了不同公司的各种手机型号的详细规格和官方发布价格。它提供了对多个国家/地区的智能手机硬件、定价趋势和品牌竞争力的见解。该数据集包括 RAM、相机规格、电池容量、处理器详细信息和屏幕大小等关键功能。

  此数据集的一个重要方面是定价信息。记录的价格代表手机首次投放市场时的官方发布价格。价格因国家/地区和发布时间而异,这意味着旧型号反映其原始发布价格,而新型号则包含其最新的发布价格。这使得该数据集对于研究随时间推移的价格趋势和比较不同地区的智能手机负担能力很有价值。

  智能手机数据集包含以下变量:

  • Company Name:手机品牌或制造商。
  • Model Name:智能手机的具体型号。
  • Mobile Weight:手机的重量(以克为单位)。
  • RAM:随机存取存储器容量(以GB为单位)。
  • Front Camera:前置摄像头的分辨率(以MP为单位)。
  • Back Camera:主后置摄像头的分辨率(以MP为单位)。
  • Processor:设备中使用的芯片组或处理器。
  • Battery Capacity:智能手机的电池容量(以mAh为单位)。
  • Screen Size:智能手机的显示尺寸(以英寸为单位)。
  • Launched Price (Pakistan):巴基斯坦的官方发布价格。
  • Launched Price (India):印度的官方发布价格。
  • Launched Price (China):中国的官方发布价格。
  • Launched Price (USA):美国的官方发布价格。
  • Launched Price (Dubai):迪拜的官方发布价格。
  • Launched Year:手机正式推出的年份。

2.2 数据清洗探索

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns

# 加载数据
df = pd.read_csv('smartphone_data.csv',encoding='ISO-8859-1')  # 请替换为实际文件路径

# 查看数据基本信息
df.shape
print(df.info())
df.isna().sum()

  从数据基本信息可发现:

  • 数据共15个维度,包含字符串和数值类型,其中只有发布年份是数值型,可视化时需要将各个国家的发布价格转成China一样维度的数值型特征。
  • 数据中一个存在930条数据记录,而且数据无缺失值存在。

  具体的特征处理代码如下:

# RAM处理
df['RAM'] = df['RAM'].apply(lambda x:x.split('GB')[0])
df['RAM'] = df['RAM'].map(float)


# 前置摄像头像素处理
df['Front Camera'] = df['Front Camera'].apply(lambda x:x.replace('Dual ',''))
df['Front Camera'] = df['Front Camera'].apply(lambda x:x.split('MP')[0])
df['Front Camera'] = df['Front Camera'].map(float)

# 
df['Back Camera'] = df['Back Camera'].apply(lambda x:x.split('MP')[0])
df['Back Camera'] = df['Back Camera'].map(float)

df['Battery Capacity'] = df['Battery Capacity'].apply(lambda x:x.replace('mAh','').replace(',',''))
df['Battery Capacity'] = df['Battery Capacity'].map(float)

df['Screen Size'] = df['Screen Size'].apply(lambda x:x.split(' ')[0])
df['Screen Size'] = df['Screen Size'].map(float)


df['Launched Price (Pakistan)'] = df['Launched Price (Pakistan)'].apply(lambda x:x.replace('PKR ','').replace(',',''))
df = df[df['Launched Price (Pakistan)'] != 'Not available']
df['Launched Price (Pakistan)'] = df['Launched Price (Pakistan)'].map(float)
df['Launched Price (Pakistan)'] = df['Launched Price (Pakistan)'] / 38.50

df['Launched Price (India)'] = df['Launched Price (India)'].apply(lambda x:x.replace('INR ','').replace(',',''))
df['Launched Price (India)'] = df['Launched Price (India)'].map(float)
df['Launched Price (India)'] = df['Launched Price (India)'] / 11.67

df['Launched Price (China)'] = df['Launched Price (China)'].apply(lambda x:x.replace('CNY ','').replace(',','').replace("¥",''))
df['Launched Price (China)'] = df['Launched Price (China)'].map(float)

df['Launched Price (USA)'] = df['Launched Price (USA)'].apply(lambda x:x.replace('USD ','').replace(',','').replace("$",''))
df['Launched Price (USA)'] = df['Launched Price (USA)'].map(float)
df['Launched Price (USA)'] = df['Launched Price (USA)'] / 0.14

df['Launched Price (Dubai)'] = df['Launched Price (Dubai)'].apply(lambda x:x.replace('AED ','').replace(',',''))
df['Launched Price (Dubai)'] = df['Launched Price (Dubai)'].map(float)
df['Launched Price (Dubai)'] = df['Launched Price (Dubai)'] / 0.5

三、单维度特征可视化

3.1 品牌分布

plt.figure(figsize=(12, 6))
sns.countplot(x='Company Name', data=df, order=df['Company Name'].value_counts().index)
plt.title('Distribution of Smartphone Brands')
plt.xlabel('Company Name')
plt.ylabel('Count')
plt.xticks(rotation=45)
plt.show()

3.2 推出年份分布

plt.figure(figsize=(10, 6))
sns.countplot(x='Launched Year', data=df)
plt.title('Distribution of Launch Years')
plt.xlabel('Launched Year')
plt.ylabel('Count')
plt.show()

3.3 RAM分布

plt.figure(figsize=(10, 6))
sns.histplot(df['RAM'], bins=10, kde=True, color='skyblue')
plt.title('RAM Distribution')
plt.xlabel('RAM (GB)')
plt.ylabel('Frequency')
plt.show()

3.4 前置摄像头像素分布

plt.figure(figsize=(10, 6))
sns.histplot(df['Front Camera'], bins=20, kde=True, color='lightgreen')
plt.title('Front Camera Distribution')
plt.xlabel('Front Camera (MP)')
plt.ylabel('Frequency')
plt.show()

3.5 后置摄像头像素分布

plt.figure(figsize=(10, 6))
sns.histplot(df['Back Camera'], bins=20, kde=True, color='lightcoral')
plt.title('Back Camera Distribution')
plt.xlabel('Back Camera (MP)')
plt.ylabel('Frequency')
plt.show()

3.6 电池容量分布

plt.figure(figsize=(10, 6))
sns.histplot(df['Battery Capacity'], bins=20, kde=True, color='gold')
plt.title('Battery Capacity Distribution')
plt.xlabel('Battery Capacity (mAh)')
plt.ylabel('Frequency')
plt.show()

3.7 屏幕尺寸分布

plt.figure(figsize=(10, 6))
sns.histplot(df['Screen Size'], bins=10, kde=True, color='purple')
plt.title('Screen Size Distribution')
plt.xlabel('Screen Size (Inches)')
plt.ylabel('Frequency')
plt.show()

四、各个特征与价格关系的可视化

4.1 品牌与价格关系

plt.figure(figsize=(14, 8))
for country in ['Launched Price (Pakistan)', 'Launched Price (India)', 'Launched Price (China)', 'Launched Price (USA)', 'Launched Price (Dubai)']:
    plt.subplot(3, 2, list(['Launched Price (Pakistan)', 'Launched Price (India)', 'Launched Price (China)', 'Launched Price (USA)', 'Launched Price (Dubai)']).index(country) + 1)
    sns.boxplot(x='Company Name', y=country, data=df)
    plt.title(f'Price Distribution by Brand in {country.split()[-1]}')
    plt.xlabel('Company Name')
    plt.ylabel('Price')
    plt.xticks(rotation=45)
plt.tight_layout()
plt.show()

在这里插入图片描述

4.2 RAM与价格关系

plt.figure(figsize=(12, 6))
for country in ['Launched Price (Pakistan)', 'Launched Price (India)', 'Launched Price (China)', 'Launched Price (USA)', 'Launched Price (Dubai)']:
    plt.figure(figsize=(10, 6))
    sns.scatterplot(x='RAM', y=country, data=df, hue='Company Name', palette='viridis')
    plt.title(f'RAM vs Price in {country.split()[-1]}')
    plt.xlabel('RAM (GB)')
    plt.ylabel('Price')
    plt.legend(bbox_to_anchor=(1.05, 1), loc='upper left')
    plt.show()

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

4.3 前置摄像头像素与价格关系

plt.figure(figsize=(12, 6))
for country in ['Launched Price (Pakistan)', 'Launched Price (India)', 'Launched Price (China)', 'Launched Price (USA)', 'Launched Price (Dubai)']:
    plt.figure(figsize=(10, 6))
    sns.scatterplot(x='Front Camera', y=country, data=df, hue='Company Name', palette='plasma')
    plt.title(f'Front Camera vs Price in {country.split()[-1]}')
    plt.xlabel('Front Camera (MP)')
    plt.ylabel('Price')
    plt.legend(bbox_to_anchor=(1.05, 1), loc='upper left')
    plt.show()

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
F

4.4 后置摄像头像素与价格关系

plt.figure(figsize=(12, 6))
for country in ['Launched Price (Pakistan)', 'Launched Price (India)', 'Launched Price (China)', 'Launched Price (USA)', 'Launched Price (Dubai)']:
    plt.figure(figsize=(10, 6))
    sns.scatterplot(x='Back Camera', y=country, data=df, hue='Company Name', palette='magma')
    plt.title(f'Back Camera vs Price in {country.split()[-1]}')
    plt.xlabel('Back Camera (MP)')
    plt.ylabel('Price')
    plt.legend(bbox_to_anchor=(1.05, 1), loc='upper left')
    plt.show()

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

4.5 电池容量与价格关系

plt.figure(figsize=(12, 6))
for country in ['Launched Price (China)']:
    plt.figure(figsize=(10, 6))
    sns.scatterplot(x='Battery Capacity', y=country, data=df, hue='Company Name', palette='cividis')
    plt.title(f'Battery Capacity vs Price in {country.split()[-1]}')
    plt.xlabel('Battery Capacity (mAh)')
    plt.ylabel('Price')
    plt.legend(bbox_to_anchor=(1.05, 1), loc='upper left')
    plt.show()

在这里插入图片描述

4.6 屏幕尺寸与价格关系

plt.figure(figsize=(12, 6))
for country in ['Launched Price (Pakistan)', 'Launched Price (India)', 'Launched Price (China)', 'Launched Price (USA)', 'Launched Price (Dubai)']:
    plt.figure(figsize=(10, 6))
    sns.scatterplot(x='Screen Size', y=country, data=df, hue='Company Name', palette='coolwarm')
    plt.title(f'Screen Size vs Price in {country.split()[-1]}')
    plt.xlabel('Screen Size (Inches)')
    plt.ylabel('Price')
    plt.legend(bbox_to_anchor=(1.05, 1), loc='upper left')
    plt.show()

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

4.7 多维度组合分析(品牌、RAM与价格)

plt.figure(figsize=(14, 8))
for country in ['Launched Price (Pakistan)', 'Launched Price (India)', 'Launched Price (China)', 'Launched Price (USA)', 'Launched Price (Dubai)']:
    plt.figure(figsize=(12, 6))
    sns.boxplot(x='Company Name', y=country, hue='RAM', data=df, palette='Set3')
    plt.title(f'Price Distribution by Brand and RAM in {country.split()[-1]}')
    plt.xlabel('Company Name')
    plt.ylabel('Price')
    plt.xticks(rotation=45)
    plt.legend(bbox_to_anchor=(1.05, 1), loc='upper left')
    plt.show()

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

从以上可视化分析可以看出:

  • 品牌分布:市场上的智能手机品牌分布广泛,少数品牌占据较大市场份额。
  • 推出年份分布:智能手机市场逐年增长,新机型不断推出。
  • RAM分布:RAM容量呈现多样化,中高端机型通常配备更高容量的RAM。
  • 前置摄像头像素分布:前置摄像头像素覆盖范围广,高端机型通常配备更高像素的前置摄像头。
  • 后置摄像头像素分布:后置摄像头像素同样呈现多样化,高端机型通常配备更高像素的后置摄像头。
  • 电池容量分布:电池容量通常集中在中等范围,高端机型可能配备更大容量的电池。
  • 屏幕尺寸分布:屏幕尺寸多样化,中等尺寸的手机最为常见。
  • 品牌与价格关系:不同品牌在不同地区的定价策略差异显著,部分品牌在某些地区价格较高。
  • RAM与价格关系:RAM容量与价格通常呈正相关关系,高RAM配置的机型价格较高。
  • 前置摄像头像素与价格关系:前置摄像头像素与价格通常呈正相关关系,高像素前置摄像头的机型价格较高。
  • 后置摄像头像素与价格关系:后置摄像头像素与价格通常呈正相关关系,高像素后置摄像头的机型价格较高。
  • 电池容量与价格关系:电池容量与价格通常呈正相关关系,大容量电池的机型价格较高。
  • 屏幕尺寸与价格关系:屏幕尺寸与价格通常呈正相关关系,大屏幕机型价格较高。

以上分析为理解智能手机市场的定价规律和消费者偏好提供了多维度视角,揭示了各硬件配置对价格的影响,为消费者购买决策和企业产品策略制定提供了数据支持。

**注:**博主目前收集了6900+份相关数据集,有想要的可以领取部分数据:

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

云天徽上

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值