pandas
安装
Terminal中运行,注意请确保前面的虚拟环境
# 安装numpy
(venv)$ pip install numpy -i https://mirrors.aliyun.com/pypi/simple
# 安装pandas
(venv)$ pip install pandas -i https://mirrors.aliyun.com/pypi/simple
(venv)$ pip install matplotlib -i https://mirrors.aliyun.com/pypi/simple数据导入
df = pd.read_excel('../uva_course_spider/session_all.excel')
#指定导入sheet
df = pd.read_excel('../uva_course_spider/session_all.excel', sheet_name='Sheet1')
#按照个数指定sheet和索引列,使用None为默认第一行
df = pd.read_excel('../uva_course_spider/session_all.excel', sheet_name=0, header=0)
#指定导入列
df = pd.read_excel('../uva_course_spider/session_all.excel', usecols=[0,2])
#导入csv文件
df = pd.read_csv('../uva_course_spider/session_all.csv', header=None, sep=',')
#指定导入行数
df = pd.read_csv('../uva_course_spider/session_all.csv', header=None, sep=',', nrows=2,encoding='utf-8')Viewing data
DataFrame
Missing Data
数据可视化
安装matplotlib
数据导出
相关教材
Last updated
Was this helpful?