【Ubuntu16.04】使用conda安装NumPy和Pandas 您所在的位置:网站首页 Anaconda怎么安装pandas包 【Ubuntu16.04】使用conda安装NumPy和Pandas

【Ubuntu16.04】使用conda安装NumPy和Pandas

2023-12-29 05:00| 来源: 网络整理| 查看: 265

前言

NumPy(Numerical Python) 是 Python 语言的一个扩展程序库,支持大量的维度数组与矩阵运算,此外也针对数组运算提供大量的数学函数库。

如果不知道怎么安装conda详细可以查看Ubuntu16.04 安装 Anaconda ,与此同时进一步查看pandas安装以及使用ubuntu16.04 熟悉 pandas

后续的学习目的也是为了更好的解决日常办公需求,所以pandas,numpy也将是我自己的学习重点;

安装NumPy和Pandas 创建自己的环境,不推荐使用base环境中 (base) cooper@cooper:~$ conda create -n cooper Collecting package metadata (current_repodata.json): done Solving environment: done ## Package Plan ## environment location: /home/cooper/anaconda3/envs/cooper Proceed ([y]/n)? y Preparing transaction: done Verifying transaction: done Executing transaction: done # # To activate this environment, use # # $ conda activate cooper # # To deactivate an active environment, use # # $ conda deactivate 激活cooper (base) cooper@cooper:~$ conda activate cooper 安装NumPy (cooper) cooper@cooper:~$ conda config --env --add channels conda-forge (cooper) cooper@cooper:~$ conda install numpy Collecting package metadata (current_repodata.json): done Solving environment: done ## Package Plan ## environment location: /home/cooper/anaconda3/envs/cooper added / updated specs: - numpy The following packages will be downloaded: package | build ---------------------------|----------------- ca-certificates-2021.10.8 | ha878542_0 139 KB conda-forge certifi-2021.10.8 | py39hf3d152e_0 144 KB conda-forge python_abi-3.9 | 2_cp39 4 KB conda-forge ------------------------------------------------------------ Total: 287 KB The following NEW packages will be INSTALLED: python_abi conda-forge/linux-64::python_abi-3.9-2_cp39 The following packages will be UPDATED: ca-certificates pkgs/main::ca-certificates-2021.9.30-~ --> conda-forge::ca-certificates-2021.10.8-ha878542_0 The following packages will be SUPERSEDED by a higher-priority channel: certifi pkgs/main::certifi-2021.10.8-py39h06a~ --> conda-forge::certifi-2021.10.8-py39hf3d152e_0 Proceed ([y]/n)? y Downloading and Extracting Packages certifi-2021.10.8 | 144 KB | ################################################################################################################################################################### | 100% python_abi-3.9 | 4 KB | ################################################################################################################################################################### | 100% ca-certificates-2021 | 139 KB | ################################################################################################################################################################### | 100% Preparing transaction: done Verifying transaction: done Executing transaction: done 安装Pandas (cooper) cooper@cooper:~$ conda install pandas Collecting package metadata (current_repodata.json): done Solving environment: done ## Package Plan ## environment location: /home/cooper/anaconda3/envs/cooper added / updated specs: - pandas The following packages will be downloaded: package | build ---------------------------|----------------- pandas-1.2.5 | py39hde0f152_0 12.1 MB conda-forge python-dateutil-2.8.2 | pyhd8ed1ab_0 240 KB conda-forge pytz-2021.3 | pyhd8ed1ab_0 242 KB conda-forge ------------------------------------------------------------ Total: 12.5 MB The following NEW packages will be INSTALLED: pandas conda-forge/linux-64::pandas-1.2.5-py39hde0f152_0 python-dateutil conda-forge/noarch::python-dateutil-2.8.2-pyhd8ed1ab_0 pytz conda-forge/noarch::pytz-2021.3-pyhd8ed1ab_0 Proceed ([y]/n)? y Downloading and Extracting Packages pandas-1.2.5 | 12.1 MB | ################################################################################################################################################################### | 100% python-dateutil-2.8. | 240 KB | ################################################################################################################################################################### | 100% pytz-2021.3 | 242 KB | ################################################################################################################################################################### | 100% Preparing transaction: done Verifying transaction: done Executing transaction: done 安装pandas依赖pytest (cooper) cooper@cooper:~$ conda install pytest Collecting package metadata (current_repodata.json): done Solving environment: done ## Package Plan ## environment location: /home/cooper/anaconda3/envs/cooper added / updated specs: - pytest The following packages will be downloaded: package | build ---------------------------|----------------- attrs-21.2.0 | pyhd8ed1ab_0 44 KB conda-forge iniconfig-1.1.1 | pyh9f0ad1d_0 8 KB conda-forge more-itertools-8.10.0 | pyhd8ed1ab_0 44 KB conda-forge packaging-21.0 | pyhd8ed1ab_0 35 KB conda-forge pluggy-1.0.0 | py39hf3d152e_1 25 KB conda-forge py-1.10.0 | pyhd3deb0d_0 73 KB conda-forge pyparsing-2.4.7 | pyh9f0ad1d_0 60 KB conda-forge pytest-6.2.5 | py39hf3d152e_0 433 KB conda-forge toml-0.10.2 | pyhd8ed1ab_0 18 KB conda-forge ------------------------------------------------------------ Total: 740 KB The following NEW packages will be INSTALLED: attrs conda-forge/noarch::attrs-21.2.0-pyhd8ed1ab_0 iniconfig conda-forge/noarch::iniconfig-1.1.1-pyh9f0ad1d_0 more-itertools conda-forge/noarch::more-itertools-8.10.0-pyhd8ed1ab_0 packaging conda-forge/noarch::packaging-21.0-pyhd8ed1ab_0 pluggy conda-forge/linux-64::pluggy-1.0.0-py39hf3d152e_1 py conda-forge/noarch::py-1.10.0-pyhd3deb0d_0 pyparsing conda-forge/noarch::pyparsing-2.4.7-pyh9f0ad1d_0 pytest conda-forge/linux-64::pytest-6.2.5-py39hf3d152e_0 toml conda-forge/noarch::toml-0.10.2-pyhd8ed1ab_0 Proceed ([y]/n)? y Downloading and Extracting Packages attrs-21.2.0 | 44 KB | ################################################################################################################################################################### | 100% pluggy-1.0.0 | 25 KB | ################################################################################################################################################################### | 100% toml-0.10.2 | 18 KB | ################################################################################################################################################################### | 100% iniconfig-1.1.1 | 8 KB | ################################################################################################################################################################### | 100% more-itertools-8.10. | 44 KB | ################################################################################################################################################################### | 100% py-1.10.0 | 73 KB | ################################################################################################################################################################### | 100% packaging-21.0 | 35 KB | ################################################################################################################################################################### | 100% pytest-6.2.5 | 433 KB | ################################################################################################################################################################### | 100% pyparsing-2.4.7 | 60 KB | ################################################################################################################################################################### | 100% Preparing transaction: done Verifying transaction: done Executing transaction: done 安装pandas依赖hypothesis (cooper) cooper@cooper:~$ conda install hypothesis Collecting package metadata (current_repodata.json): done Solving environment: done ## Package Plan ## environment location: /home/cooper/anaconda3/envs/cooper added / updated specs: - hypothesis The following packages will be downloaded: package | build ---------------------------|----------------- click-8.0.3 | py39hf3d152e_0 146 KB conda-forge hypothesis-6.23.4 | pyhd8ed1ab_0 249 KB conda-forge sortedcontainers-2.4.0 | pyhd8ed1ab_0 26 KB conda-forge ------------------------------------------------------------ Total: 422 KB The following NEW packages will be INSTALLED: click conda-forge/linux-64::click-8.0.3-py39hf3d152e_0 hypothesis conda-forge/noarch::hypothesis-6.23.4-pyhd8ed1ab_0 sortedcontainers conda-forge/noarch::sortedcontainers-2.4.0-pyhd8ed1ab_0 Proceed ([y]/n)? y Downloading and Extracting Packages sortedcontainers-2.4 | 26 KB | ################################################################################################################################################################### | 100% hypothesis-6.23.4 | 249 KB | ################################################################################################################################################################### | 100% click-8.0.3 | 146 KB | ################################################################################################################################################################### | 100% Preparing transaction: done Verifying transaction: done Executing transaction: done 单元测试Pandas

这个测试可能要耗费一段时间,耐心等一会;

>>> import pandas as pd >>> pd.test() running: pytest --skip-slow --skip-network --skip-db /home/cooper/anaconda3/envs/cooper/lib/python3.9/site-packages/pandas ============================================================================================ test session starts ============================================================================================= platform linux -- Python 3.9.7, pytest-6.2.5, py-1.10.0, pluggy-1.0.0 rootdir: /home/cooper plugins: hypothesis-6.23.4 collected 152863 items / 21 skipped / 152842 selected

测试最后结果,中间过程省略:

========================================================================================== short test summary info =========================================================================================== FAILED anaconda3/envs/cooper/lib/python3.9/site-packages/pandas/tests/io/test_clipboard.py::test_raw_roundtrip[\U0001f44d...] - pandas.io.clipboard.PyperclipException: FAILED anaconda3/envs/cooper/lib/python3.9/site-packages/pandas/tests/io/test_clipboard.py::test_raw_roundtrip[\u03a9\u0153\u2211\xb4...] - pandas.io.clipboard.PyperclipException: FAILED anaconda3/envs/cooper/lib/python3.9/site-packages/pandas/tests/io/test_clipboard.py::test_raw_roundtrip[abcd...] - pandas.io.clipboard.PyperclipException: ERROR anaconda3/envs/cooper/lib/python3.9/site-packages/pandas/tests/io/test_parquet.py::TestParquetPyArrow::test_s3_roundtrip_explicit_fs ERROR anaconda3/envs/cooper/lib/python3.9/site-packages/pandas/tests/io/test_parquet.py::TestParquetPyArrow::test_s3_roundtrip ERROR anaconda3/envs/cooper/lib/python3.9/site-packages/pandas/tests/io/test_parquet.py::TestParquetFastParquet::test_s3_roundtrip ERROR anaconda3/envs/cooper/lib/python3.9/site-packages/pandas/tests/io/json/test_compression.py::test_with_s3_url[None] ERROR anaconda3/envs/cooper/lib/python3.9/site-packages/pandas/tests/io/json/test_compression.py::test_with_s3_url[gzip] ERROR anaconda3/envs/cooper/lib/python3.9/site-packages/pandas/tests/io/json/test_compression.py::test_with_s3_url[bz2] ERROR anaconda3/envs/cooper/lib/python3.9/site-packages/pandas/tests/io/json/test_compression.py::test_with_s3_url[zip] ERROR anaconda3/envs/cooper/lib/python3.9/site-packages/pandas/tests/io/json/test_compression.py::test_with_s3_url[xz] ERROR anaconda3/envs/cooper/lib/python3.9/site-packages/pandas/tests/io/json/test_pandas.py::TestPandasContainer::test_read_s3_jsonl ERROR anaconda3/envs/cooper/lib/python3.9/site-packages/pandas/tests/io/json/test_pandas.py::TestPandasContainer::test_to_s3 ERROR anaconda3/envs/cooper/lib/python3.9/site-packages/pandas/tests/io/parser/test_network.py::TestS3::test_parse_public_s3n_bucket ERROR anaconda3/envs/cooper/lib/python3.9/site-packages/pandas/tests/io/parser/test_network.py::TestS3::test_parse_public_s3a_bucket ERROR anaconda3/envs/cooper/lib/python3.9/site-packages/pandas/tests/io/parser/test_network.py::TestS3::test_parse_public_s3_bucket_nrows ERROR anaconda3/envs/cooper/lib/python3.9/site-packages/pandas/tests/io/parser/test_network.py::TestS3::test_parse_public_s3_bucket_chunked ERROR anaconda3/envs/cooper/lib/python3.9/site-packages/pandas/tests/io/parser/test_network.py::TestS3::test_parse_public_s3_bucket_chunked_python ERROR anaconda3/envs/cooper/lib/python3.9/site-packages/pandas/tests/io/parser/test_network.py::TestS3::test_parse_public_s3_bucket_python ERROR anaconda3/envs/cooper/lib/python3.9/site-packages/pandas/tests/io/parser/test_network.py::TestS3::test_infer_s3_compression ERROR anaconda3/envs/cooper/lib/python3.9/site-packages/pandas/tests/io/parser/test_network.py::TestS3::test_parse_public_s3_bucket_nrows_python ERROR anaconda3/envs/cooper/lib/python3.9/site-packages/pandas/tests/io/parser/test_network.py::TestS3::test_read_s3_fails ERROR anaconda3/envs/cooper/lib/python3.9/site-packages/pandas/tests/io/parser/test_network.py::TestS3::test_read_csv_handles_boto_s3_object ERROR anaconda3/envs/cooper/lib/python3.9/site-packages/pandas/tests/io/parser/test_network.py::TestS3::test_read_csv_chunked_download ERROR anaconda3/envs/cooper/lib/python3.9/site-packages/pandas/tests/io/parser/test_network.py::TestS3::test_read_s3_with_hash_in_key ================================================ 3 failed, 134087 passed, 17679 skipped, 1051 xfailed, 42 xpassed, 4 warnings, 22 errors in 733.99s (0:12:13) ================================================

有3 failed,不知道需要不需要处理,后面如果遇到问题会再跟进;

结束

今天送别了一位公司同事,一同和我们并肩奋斗三年多;给我留下了深刻的印象,一开始就在一起调试Camera,Audio,Display,他辅助帮忙整理硬件和结构的问题,我处理软件的问题;之后项目启动,基本为期两年的管理供应商,我们一直配合处理,默契很好;当我处理不了的问题,他能协助,他也是很积极肯干的人,给我最深的印象就是,联系供应商协助解决问题,不管现在是几点,是不是周末,说做马上就去做;而我确实不太愿意在特别的时间打扰别人,而他可以做到;

如今他要走,我却不知道怎么送别,这对我来说也可能快到这个岁数了,会遇到自己的瓶颈;

但是我们沟通对我触动很大的是,从来到现在的公司,一直在输出,却很少对自己有提高,这可能是我们大多数人的一个状况;忙碌的不知道自己在做什么,也不知道做这些对自己成长的意义,根本不去想我做这些能给自己,或者组织带来什么质地的变化;我感觉迷茫了,对于我自己来说,我需要继续努力学习,改变自己,让自己更能在这个北京呆下去,也许这样才能优雅的活着;



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有