Python 数据分析入门
环境搭建
pip install pandas matplotlib numpy
Pandas 基础
Pandas 是 Python 最强大的数据处理库。
import pandas as pd
# 读取数据
df = pd.read_csv('data.csv')
# 查看数据概览
print(df.head())
print(df.describe())
数据可视化
使用 Matplotlib 创建图表:
import matplotlib.pyplot as plt
df['column'].plot(kind='bar')
plt.show()
实战案例
分析销售数据,找出最畅销的产品。