Python模块之 pandas

模块作用简介:

1、Python Data Analysis Library 或 pandas 是基于NumPy 的一种工具,该工具是为了解决数据分析任务而创建的。Pandas 纳入了大量库和一些标准的数据模型,提供了高效地操作大型数据集所需的工具。pandas提供了大量能使我们快速便捷地处理数据的函数和方法。你很快就会发现,它是使Python成为强大而高效的数据分析环境的重要因素之一。

2、Pandas 是python的一个数据分析包,最初由AQR Capital Management于2008年4月开发,并于2009年底开源出来,目前由专注于Python数据包开发的PyData开发team继续开发和维护,属于PyData项目的一部分。Pandas最初被作为金融数据分析工具而开发出来,因此,pandas为时间序列分析提供了很好的支持。 Pandas的名称来自于面板数据(panel data)和python数据分析(data analysis)。panel data是经济学中关于多维数据集的一个术语,在Pandas中也提供了panel的数据类型。
https://blog.csdn.net/aasdad1/article/details/91812714



必要操作:

>>> import pandas


安装:

>>> pip install openpyxl
>>> pip install pandas

如果官网安装慢, 可以修改下载源:
pip3 install pandas -i http://pypi.doubanio.com/simple --trusted-host pypi.doubanio.com

pip3 install pandas -i http://pypi.mirrors.ustc.edu.cn/simple/ --trusted-host pypi.mirrors.ustc.edu.cn



导入包:

>>> import pandas as pd


帮助查看:

>>> help(pandas)


方法(函数):

>>> import pandas as pd


参数



返回值

返回True,否则返回False。



卸载 pandas 模块:

>>> pip3 uninstall pandas

在 uninstall 后加 -y 参数,不提醒

卸载 pandas 依赖模块:

(谨慎卸载,可能其他模块在用)

>>>pip3 uninstall numpy pandas python-dateutil pytz six tzdata

在 uninstall 后加 -y 参数,不提醒


卸载 openpyxl 模块:

>>> pip3 uninstall openpyxl

在 uninstall 后加 -y 参数,不提醒

卸载 openpyxl 依赖模块:

(谨慎卸载,可能其他模块在用)

>>>pip3 uninstall et-xmlfile

在 uninstall 后加 -y 参数,不提醒



使用示例:

https://www.cnblogs.com/wutou/p/17811592.html


问题:

问题1:

提示 --no-warn-script-location 参数

 WARNING: The scripts f2py, f2py3 and f2py3.8 are installed in '/home/qt/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

image
原因:
没有安装到指定目录,而安装的目录不在环境变量中。
解决方法:
加入-U (大写U) 来关闭提示

pip3 install pandas -U -i http://pypi.doubanio.com/simple  --trusted-host pypi.doubanio.com





参考、来源:
Python安装包下载:https://www.cnblogs.com/wutou/p/17709685.html
Pip 源设置:https://www.cnblogs.com/wutou/p/17531296.html
pip 安装指定版本模块:https://www.cnblogs.com/wutou/p/17716203.html

https://blog.csdn.net/xuxu_boke/article/details/120696515







posted @ 2023-11-06 09:37  悟透  阅读(23)  评论(0编辑  收藏  举报