Python 数据分析实战:低空经济行业发展洞察

目录

一、案例背景

二、代码实现

2.1 数据收集

2.2 数据探索性分析

2.3 数据清洗

2.4 数据分析

2.4.1 低空经济技术热点追踪

2.4.2 低空经济在不同领域的应用分析

2.4.3 低空经济市场增长预测

三、主要的代码难点解析

3.1 数据收集

3.2 数据清洗 - 行业数据异常值处理

3.3 数据分析 - 低空经济技术热点追踪

3.4 数据分析 - 低空经济在不同领域的应用分析

3.5 数据可视化

四、可能改进的代码

4.1 数据收集改进


一、案例背景

随着无人机技术的成熟、政策的逐步放开以及市场需求的多样化,低空经济正迅速崛起,成为经济发展的新引擎。从物流配送、农林植保、测绘勘探到应急救援等多个领域,低空经济展现出了巨大的潜力和应用价值。通过 Python 对低空经济行业相关数据进行全面且深入的分析,能够清晰地呈现出该行业的发展现状、市场规模的增长趋势、应用场景的拓展情况以及面临的挑战,为行业从业者、投资者、政策制定者等提供关键的决策支持,助力各方在低空经济这片新兴蓝海中找准方向,实现快速发展。

二、代码实现

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import requests
from bs4 import BeautifulSoup

2.1 数据收集

数据来源涵盖专业航空航天资讯平台(如 Aviation Week Network、FlightGlobal)、行业研究机构报告(如 Gartner 针对新兴技术的报告、专门的无人机行业研究机构报告)、政府部门发布的政策法规和统计数据(如民航局、工信部)以及相关企业的公开财报和产品数据。

  • 从专业航空航天资讯平台收集低空经济相关新闻文章数据,以 Aviation Week Network 为例:

url = 'https://www.aviationweek.com/search/site/low-altitude%20economy'
headers = {
    'User - Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'
}
response = requests.get(url, headers = headers)
soup = BeautifulSoup(response.text, 'html.parser')

article_data = []
article_items = soup.find_all('div', class_='search-result')
for item in article_items:
    title = item.find('h3').text.strip()
    summary = item.find('p').text.strip()
    publish_time = item.find('time')['datetime']
    article_data.append({'Title': title, 'Summary': summary, 'Publish_Time': publish_time})

article_df = pd.DataFrame(article_data)

  • 从行业研究机构网站获取低空经济市场规模、无人机出货量等数据,假设通过其提供的 API 获取(实际需依 API 文档开发):

# 示例结构,实际实现需依API文档
import json
url = 'https://api.droneindustryinsights.com/low_altitude_economy_data'
headers = {
    'Authorization': 'your_api_key',
    'Content - Type': 'application/json'
}
response = requests.get(url, headers = headers)
if response.status_code == 200:
    industry_data = json.loads(response.text)
    industry_df = pd.DataFrame(industry_data)
else:
    print('Failed to get industry data')

2.2 数据探索性分析

# 查看文章数据基本信息
print(article_df.info())

# 查看行业数据基本信息
print(industry_df.info())

# 统计文章发布时间分布
article_df['Publish_Time'] = pd.to_datetime(article_df['Publish_Time'])
article_df['Month'] = article_df['Publish_Time'].dt.month
month_count = article_df['Month'].value_counts().sort_index()

plt.figure(figsize=(12, 6))
sns.barplot(x = month_count.index, y = month_count.values)
plt.title('Distribution of Low - Altitude Economy Article Publication Months')
plt.xlabel('Month')
plt.ylabel('Article Count')
plt.show()

# 查看低空经济市场规模随时间变化趋势(假设市场数据有时间和规模字段)
industry_df['Time'] = pd.to_datetime(industry_df['Time'])
plt.figure(figsize=(12, 6))
sns.lineplot(x = 'Time', y = 'Market_Size', data = industry_df)
plt.title('Trend of Low - Altitude Economy Market Size')
plt.xlabel('Time')
plt.ylabel('Market Size (in billions)')
plt.show()

2.3 数据清洗

# 文章数据清洗
# 去除重复文章(根据标题判断)
article_df = article_df.drop_duplicates(subset='Title')

# 处理缺失值
article_df.dropna(inplace = True)

# 行业数据清洗
# 检查数据完整性,处理异常值
industry_df = ind
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

萧十一郎@

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

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

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

打赏作者

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

抵扣说明:

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

余额充值