Giter VIP home page Giter VIP logo

stefmolin / hands-on-data-analysis-with-pandas Goto Github PK

View Code? Open in Web Editor NEW
405.0 19.0 806.0 31.93 MB

Materials for following along with Hands-On Data Analysis with Pandas.

Home Page: https://www.amazon.com/Hands-Data-Analysis-Pandas-visualization/dp/1789615321/

License: MIT License

Jupyter Notebook 99.72% Python 0.26% Shell 0.02%
data-analysis data-science data-wrangling machine-learning pandas python matplotlib datascience

hands-on-data-analysis-with-pandas's Introduction

Hands-On Data Analysis with Pandas

Binder Open In Colab Nbviewer Purchase the book on Amazon Hands-On Data Analysis with Pandas

This is the code repository for my book Hands-On Data Analysis with Pandas, published by Packt on July 26, 2019.

The 1st_edition tag contains all materials as they were at time of publishing the first edition.


IMPORTANT NOTE (April 29, 2021):

This is the code repository for the first edition. For the second edition, use this repository instead.


Book Description

Data analysis has become an essential skill in a variety of domains where knowing how to work with data and extract insights can generate significant value.

Hands-On Data Analysis with Pandas will show you how to analyze your data, get started with machine learning, and work effectively with Python libraries often used for data science, such as pandas, NumPy, matplotlib, seaborn, and scikit-learn. Using real-world datasets, you will learn how to use the powerful pandas library to perform data wrangling to reshape, clean, and aggregate your data. Then, you will learn how to conduct exploratory data analysis by calculating summary statistics and visualizing the data to find patterns. In the concluding chapters, you will explore some applications of anomaly detection, regression, clustering, and classification, using scikit-learn, to make predictions based on past data.

By the end of this book, you will be equipped with the skills you need to use pandas to ensure the veracity of your data, visualize it for effective decision-making, and reliably reproduce analysis across multiple domains.

What You Will Learn

Prerequisite: Basic knowledge of Python or past experience with another language (R, SAS, MATLAB, etc.).

  • Understand how data analysts and scientists gather and analyze data
  • Perform data analysis and data wrangling in Python
  • Combine, group, and aggregate data from multiple sources
  • Create data visualizations with pandas, matplotlib, and seaborn
  • Apply machine learning algorithms with sklearn to identify patterns and make predictions
  • Use Python data science libraries to analyze real-world datasets.
  • Use pandas to solve several common data representation and analysis problems
  • Collect data from APIs
  • Build Python scripts, modules, and packages for reusable analysis code.
  • Utilize computer science concepts and algorithms to write more efficient code for data analysis
  • Write and run simulations

Table of Contents

Notes on Environment Setup

Env Build Workflow Status GitHub repo size

Environment setup instructions are in the chapter 1 of the text. If you don't have the book, you must install Python 3.6 or 3.7, set up a virtual environment, activate it, and then install the packages listed in requirements.txt. You can then launch JupyterLab and use the ch_01/checking_your_setup.ipynb Jupyter notebook to check your setup. Consult this resource if you have issues with using your virtual environment in Jupyter.

Solutions

Each chapter comes with exercises. The solutions for chapters 1-11 can be found here.

About the Author

Stefanie Molin (@stefmolin) is a software engineer and data scientist at Bloomberg in New York City, where she tackles tough problems in information security, particularly those revolving around data wrangling/visualization, building tools for gathering data, and knowledge sharing. She holds a bachelor’s of science degree in operations research from Columbia University's Fu Foundation School of Engineering and Applied Science with minors in Economics and Entrepreneurship and Innovation, as well as a master’s degree in computer science, with a specialization in machine learning, from Georgia Tech. In her free time, she enjoys traveling the world, inventing new recipes, and learning new languages spoken both among people and computers.

Acknowledgements

Since the book limited the acknowledgements to 450 characters, the full version is here.

hands-on-data-analysis-with-pandas's People

Contributors

kthprog avatar stefmolin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hands-on-data-analysis-with-pandas's Issues

Installation of scipy 1.2.1 fails when using python 3.8.0.

Required attestation

  • [✅] I have completely and exactly followed the virtual environment setup instructions from the book.
  • [✅] I have cloned either this repository or my fork of this repository so that I have all necessary files on my local machine.
  • [✅] I have checked that this issue has not already been reported or resolved here.
  • [✅] I am aware that there is a pre-built Binder environment that I can use, but I want to install locally on my machine instead.

Background information

1. Which OS are you using?

macOS Ventura 13.2.1 on a 2017 Macbook Pro

2. Which Python version are you using?

Python 3.8.0

3. Are you using conda or venv?

venv


Commands run and their outputs

Please provide all of the commands you ran as well as the traceback:

I begun by creating the virtual environment using venv then proceeded to upgrade pip and install numpy first as pointed out in #6. I then installed the packages in requirements.txt but it stopped at scipy. I tries to install scipy separately but still failed.

(book_env) HouseShare-MacBook-Pro:Hands-On-Data-Analysis-with-Pandas Hilary$ pip install --upgrade pip
Collecting pip
Using cached https://files.pythonhosted.org/packages/07/51/2c0959c5adf988c44d9e1e0d940f5b074516ecc87e96b1af25f59de9ba38/pip-23.0.1-py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 19.2.3
Uninstalling pip-19.2.3:
Successfully uninstalled pip-19.2.3
Successfully installed pip-23.0.1
(book_env) HouseShare-MacBook-Pro:Hands-On-Data-Analysis-with-Pandas Hilary$ pip install numpy==1.16.3
Collecting numpy==1.16.3
Using cached numpy-1.16.3.zip (5.1 MB)
Preparing metadata (setup.py) ... done
Installing collected packages: numpy
DEPRECATION: numpy is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at pypa/pip#8559
Running setup.py install for numpy ... done
Successfully installed numpy-1.16.3
(book_env) HouseShare-MacBook-Pro:Hands-On-Data-Analysis-with-Pandas Hilary$ pip install -r requirements.txt
Collecting git+https://github.com/stefmolin/login-attempt-simulator.git@pandas_book (from -r requirements.txt (line 14))
Cloning https://github.com/stefmolin/login-attempt-simulator.git (to revision pandas_book) to /private/var/folders/1h/xsc0xzkn5lgbrfws7879hf1m0000gr/T/pip-req-build-dw5fuw79
Running command git clone --filter=blob:none --quiet https://github.com/stefmolin/login-attempt-simulator.git /private/var/folders/1h/xsc0xzkn5lgbrfws7879hf1m0000gr/T/pip-req-build-dw5fuw79
Running command git checkout -q 4e386dc47d204de95c2d2b86efd9b9c55f60ee73
Resolved https://github.com/stefmolin/login-attempt-simulator.git to commit 4e386dc47d204de95c2d2b86efd9b9c55f60ee73
Preparing metadata (setup.py) ... done
Collecting git+https://github.com/stefmolin/ml-utils.git@pandas_book (from -r requirements.txt (line 15))
Cloning https://github.com/stefmolin/ml-utils.git (to revision pandas_book) to /private/var/folders/1h/xsc0xzkn5lgbrfws7879hf1m0000gr/T/pip-req-build-5rarpkrt
Running command git clone --filter=blob:none --quiet https://github.com/stefmolin/ml-utils.git /private/var/folders/1h/xsc0xzkn5lgbrfws7879hf1m0000gr/T/pip-req-build-5rarpkrt
Running command git checkout -q 17934bedd6319957c698092d320ec23f4aa7e093
Resolved https://github.com/stefmolin/ml-utils.git to commit 17934bedd6319957c698092d320ec23f4aa7e093
Preparing metadata (setup.py) ... done
Collecting git+https://github.com/stefmolin/stock-analysis.git@pandas_book (from -r requirements.txt (line 16))
Cloning https://github.com/stefmolin/stock-analysis.git (to revision pandas_book) to /private/var/folders/1h/xsc0xzkn5lgbrfws7879hf1m0000gr/T/pip-req-build-ya9mr7az
Running command git clone --filter=blob:none --quiet https://github.com/stefmolin/stock-analysis.git /private/var/folders/1h/xsc0xzkn5lgbrfws7879hf1m0000gr/T/pip-req-build-ya9mr7az
Running command git checkout -q 9eeb9d105eb84a8bea53423378d0a8a87e2e2206
Resolved https://github.com/stefmolin/stock-analysis.git to commit 9eeb9d105eb84a8bea53423378d0a8a87e2e2206
Preparing metadata (setup.py) ... done
Collecting graphviz==0.10.1
Using cached graphviz-0.10.1-py2.py3-none-any.whl (16 kB)
Requirement already satisfied: numpy==1.16.3 in ./book_env/lib/python3.8/site-packages (from -r requirements.txt (line 2)) (1.16.3)
Collecting imbalanced-learn==0.4.3
Using cached imbalanced_learn-0.4.3-py3-none-any.whl (166 kB)
Collecting jupyterlab==0.35.6
Using cached jupyterlab-0.35.6-py3-none-any.whl (14.8 MB)
Collecting matplotlib==3.0.3
Using cached matplotlib-3.0.3.tar.gz (36.6 MB)
Preparing metadata (setup.py) ... done
Collecting pandas==0.23.4
Using cached pandas-0.23.4.tar.gz (10.5 MB)
Preparing metadata (setup.py) ... done
Collecting pandas-datareader==0.7.0
Using cached pandas_datareader-0.7.0-py2.py3-none-any.whl (111 kB)
Collecting requests==2.21.0
Using cached requests-2.21.0-py2.py3-none-any.whl (57 kB)
Collecting scikit-learn==0.20.3
Using cached scikit-learn-0.20.3.tar.gz (11.8 MB)
Preparing metadata (setup.py) ... done
Collecting scipy==1.2.1
Using cached scipy-1.2.1.tar.gz (23.1 MB)
Preparing metadata (setup.py) ... done
Collecting seaborn==0.9.0
Using cached seaborn-0.9.0-py3-none-any.whl (208 kB)
Collecting sqlalchemy==1.3.3
Using cached SQLAlchemy-1.3.3.tar.gz (5.9 MB)
Preparing metadata (setup.py) ... done
Collecting statsmodels==0.9.0
Using cached statsmodels-0.9.0.tar.gz (12.7 MB)
Preparing metadata (setup.py) ... done
Collecting notebook>=4.3.1
Using cached notebook-6.5.3-py3-none-any.whl (529 kB)
Collecting jupyterlab-server<0.3.0,>=0.2.0
Using cached jupyterlab_server-0.2.0-py3-none-any.whl (28 kB)
Collecting cycler>=0.10
Using cached cycler-0.11.0-py3-none-any.whl (6.4 kB)
Collecting kiwisolver>=1.0.1
Using cached kiwisolver-1.4.4-cp38-cp38-macosx_10_9_x86_64.whl (65 kB)
Collecting pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1
Using cached pyparsing-3.0.9-py3-none-any.whl (98 kB)
Collecting python-dateutil>=2.1
Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
Collecting pytz>=2011k
Using cached pytz-2022.7.1-py2.py3-none-any.whl (499 kB)
Collecting lxml
Using cached lxml-4.9.2-cp38-cp38-macosx_10_15_x86_64.whl (4.7 MB)
Collecting wrapt
Using cached wrapt-1.15.0-cp38-cp38-macosx_10_9_x86_64.whl (35 kB)
Collecting chardet<3.1.0,>=3.0.2
Using cached chardet-3.0.4-py2.py3-none-any.whl (133 kB)
Collecting idna<2.9,>=2.5
Using cached idna-2.8-py2.py3-none-any.whl (58 kB)
Collecting certifi>=2017.4.17
Using cached certifi-2022.12.7-py3-none-any.whl (155 kB)
Collecting urllib3<1.25,>=1.21.1
Using cached urllib3-1.24.3-py2.py3-none-any.whl (118 kB)
Collecting patsy
Using cached patsy-0.5.3-py2.py3-none-any.whl (233 kB)
Collecting jsonschema>=2.6.0
Using cached jsonschema-4.17.3-py3-none-any.whl (90 kB)
Collecting pyzmq>=17
Using cached pyzmq-25.0.0-cp38-cp38-macosx_10_15_universal2.whl (1.8 MB)
Collecting prometheus-client
Using cached prometheus_client-0.16.0-py3-none-any.whl (122 kB)
Collecting traitlets>=4.2.1
Using cached traitlets-5.9.0-py3-none-any.whl (117 kB)
Collecting nbconvert>=5
Using cached nbconvert-7.2.9-py3-none-any.whl (274 kB)
Collecting argon2-cffi
Using cached argon2_cffi-21.3.0-py3-none-any.whl (14 kB)
Collecting nbformat
Using cached nbformat-5.7.3-py3-none-any.whl (78 kB)
Collecting nest-asyncio>=1.5
Using cached nest_asyncio-1.5.6-py3-none-any.whl (5.2 kB)
Collecting nbclassic>=0.4.7
Using cached nbclassic-0.5.3-py3-none-any.whl (10.0 MB)
Collecting terminado>=0.8.3
Using cached terminado-0.17.1-py3-none-any.whl (17 kB)
Collecting jupyter-core>=4.6.1
Using cached jupyter_core-5.2.0-py3-none-any.whl (94 kB)
Collecting jupyter-client>=5.3.4
Using cached jupyter_client-8.0.3-py3-none-any.whl (102 kB)
Collecting ipykernel
Using cached ipykernel-6.21.3-py3-none-any.whl (149 kB)
Collecting ipython-genutils
Using cached ipython_genutils-0.2.0-py2.py3-none-any.whl (26 kB)
Collecting Send2Trash>=1.8.0
Using cached Send2Trash-1.8.0-py3-none-any.whl (18 kB)
Collecting jinja2
Using cached Jinja2-3.1.2-py3-none-any.whl (133 kB)
Collecting tornado>=6.1
Using cached tornado-6.2-cp37-abi3-macosx_10_9_x86_64.whl (419 kB)
Collecting six>=1.5
Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting pkgutil-resolve-name>=1.3.10
Using cached pkgutil_resolve_name-1.3.10-py3-none-any.whl (4.7 kB)
Collecting importlib-resources>=1.4.0
Using cached importlib_resources-5.12.0-py3-none-any.whl (36 kB)
Collecting pyrsistent!=0.17.0,!=0.17.1,!=0.17.2,>=0.14.0
Using cached pyrsistent-0.19.3-cp38-cp38-macosx_10_9_universal2.whl (82 kB)
Collecting attrs>=17.4.0
Using cached attrs-22.2.0-py3-none-any.whl (60 kB)
Collecting importlib-metadata>=4.8.3
Using cached importlib_metadata-6.0.0-py3-none-any.whl (21 kB)
Collecting platformdirs>=2.5
Using cached platformdirs-3.1.0-py3-none-any.whl (14 kB)
Collecting jupyter-server>=1.8
Using cached jupyter_server-2.4.0-py3-none-any.whl (366 kB)
Collecting notebook-shim>=0.1.0
Using cached notebook_shim-0.2.2-py3-none-any.whl (13 kB)
Collecting jupyterlab-pygments
Using cached jupyterlab_pygments-0.2.2-py2.py3-none-any.whl (21 kB)
Collecting bleach
Using cached bleach-6.0.0-py3-none-any.whl (162 kB)
Collecting beautifulsoup4
Using cached beautifulsoup4-4.11.2-py3-none-any.whl (129 kB)
Collecting pandocfilters>=1.4.1
Using cached pandocfilters-1.5.0-py2.py3-none-any.whl (8.7 kB)
Collecting mistune<3,>=2.0.3
Using cached mistune-2.0.5-py2.py3-none-any.whl (24 kB)
Collecting packaging
Using cached packaging-23.0-py3-none-any.whl (42 kB)
Collecting nbclient>=0.5.0
Using cached nbclient-0.7.2-py3-none-any.whl (71 kB)
Collecting markupsafe>=2.0
Using cached MarkupSafe-2.1.2-cp38-cp38-macosx_10_9_x86_64.whl (13 kB)
Collecting tinycss2
Using cached tinycss2-1.2.1-py3-none-any.whl (21 kB)
Collecting defusedxml
Using cached defusedxml-0.7.1-py2.py3-none-any.whl (25 kB)
Collecting pygments>=2.4.1
Using cached Pygments-2.14.0-py3-none-any.whl (1.1 MB)
Collecting fastjsonschema
Using cached fastjsonschema-2.16.3-py3-none-any.whl (23 kB)
Collecting ptyprocess
Using cached ptyprocess-0.7.0-py2.py3-none-any.whl (13 kB)
Collecting argon2-cffi-bindings
Using cached argon2_cffi_bindings-21.2.0-cp38-abi3-macosx_10_9_universal2.whl (53 kB)
Collecting appnope
Using cached appnope-0.1.3-py2.py3-none-any.whl (4.4 kB)
Collecting psutil
Using cached psutil-5.9.4-cp36-abi3-macosx_10_9_x86_64.whl (243 kB)
Collecting comm>=0.1.1
Using cached comm-0.1.2-py3-none-any.whl (6.5 kB)
Collecting ipython>=7.23.1
Using cached ipython-8.11.0-py3-none-any.whl (793 kB)
Collecting debugpy>=1.6.5
Using cached debugpy-1.6.6-cp38-cp38-macosx_10_15_x86_64.whl (1.7 MB)
Collecting matplotlib-inline>=0.1
Using cached matplotlib_inline-0.1.6-py3-none-any.whl (9.4 kB)
Collecting zipp>=0.5
Using cached zipp-3.15.0-py3-none-any.whl (6.8 kB)
Collecting decorator
Using cached decorator-5.1.1-py3-none-any.whl (9.1 kB)
Collecting stack-data
Using cached stack_data-0.6.2-py3-none-any.whl (24 kB)
Collecting jedi>=0.16
Using cached jedi-0.18.2-py2.py3-none-any.whl (1.6 MB)
Collecting pickleshare
Using cached pickleshare-0.7.5-py2.py3-none-any.whl (6.9 kB)
Collecting prompt-toolkit!=3.0.37,<3.1.0,>=3.0.30
Using cached prompt_toolkit-3.0.38-py3-none-any.whl (385 kB)
Collecting pexpect>4.3
Using cached pexpect-4.8.0-py2.py3-none-any.whl (59 kB)
Collecting backcall
Using cached backcall-0.2.0-py2.py3-none-any.whl (11 kB)
Collecting anyio>=3.1.0
Using cached anyio-3.6.2-py3-none-any.whl (80 kB)
Collecting websocket-client
Using cached websocket_client-1.5.1-py3-none-any.whl (55 kB)
Collecting jupyter-events>=0.4.0
Using cached jupyter_events-0.6.3-py3-none-any.whl (18 kB)
Collecting jupyter-server-terminals
Using cached jupyter_server_terminals-0.4.4-py3-none-any.whl (13 kB)
Collecting cffi>=1.0.1
Using cached cffi-1.15.1-cp38-cp38-macosx_10_9_x86_64.whl (178 kB)
Collecting soupsieve>1.2
Using cached soupsieve-2.4-py3-none-any.whl (37 kB)
Collecting webencodings
Using cached webencodings-0.5.1-py2.py3-none-any.whl (11 kB)
Collecting sniffio>=1.1
Using cached sniffio-1.3.0-py3-none-any.whl (10 kB)
Collecting pycparser
Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Collecting parso<0.9.0,>=0.8.0
Using cached parso-0.8.3-py2.py3-none-any.whl (100 kB)
Collecting pyyaml>=5.3
Using cached PyYAML-6.0-cp38-cp38-macosx_10_9_x86_64.whl (192 kB)
Collecting rfc3339-validator
Using cached rfc3339_validator-0.1.4-py2.py3-none-any.whl (3.5 kB)
Collecting python-json-logger>=2.0.4
Using cached python_json_logger-2.0.7-py3-none-any.whl (8.1 kB)
Collecting rfc3986-validator>=0.1.1
Using cached rfc3986_validator-0.1.1-py2.py3-none-any.whl (4.2 kB)
Collecting wcwidth
Using cached wcwidth-0.2.6-py2.py3-none-any.whl (29 kB)
Collecting pure-eval
Using cached pure_eval-0.2.2-py3-none-any.whl (11 kB)
Collecting executing>=1.2.0
Using cached executing-1.2.0-py2.py3-none-any.whl (24 kB)
Collecting asttokens>=2.1.0
Using cached asttokens-2.2.1-py2.py3-none-any.whl (26 kB)
Collecting fqdn
Using cached fqdn-1.5.1-py3-none-any.whl (9.1 kB)
Collecting isoduration
Using cached isoduration-20.11.0-py3-none-any.whl (11 kB)
Collecting webcolors>=1.11
Using cached webcolors-1.12-py3-none-any.whl (9.9 kB)
Collecting jsonpointer>1.13
Using cached jsonpointer-2.3-py2.py3-none-any.whl (7.8 kB)
Collecting uri-template
Using cached uri_template-1.2.0-py3-none-any.whl (10 kB)
Collecting arrow>=0.15.0
Using cached arrow-1.2.3-py3-none-any.whl (66 kB)
Installing collected packages: webencodings, wcwidth, Send2Trash, pytz, pure-eval, ptyprocess, pickleshare, mistune, ipython-genutils, fastjsonschema, executing, chardet, backcall, appnope, zipp, wrapt, websocket-client, webcolors, urllib3, uri-template, traitlets, tornado, tinycss2, sqlalchemy, soupsieve, sniffio, six, scipy, rfc3986-validator, pyzmq, pyyaml, python-json-logger, pyrsistent, pyparsing, pygments, pycparser, psutil, prompt-toolkit, prometheus-client, platformdirs, pkgutil-resolve-name, pexpect, parso, pandocfilters, packaging, nest-asyncio, markupsafe, lxml, kiwisolver, jupyterlab-pygments, jsonpointer, idna, graphviz, fqdn, defusedxml, decorator, debugpy, cycler, certifi, attrs, terminado, scikit-learn, rfc3339-validator, requests, python-dateutil, patsy, matplotlib-inline, jupyter-core, jinja2, jedi, importlib-resources, importlib-metadata, comm, cffi, bleach, beautifulsoup4, asttokens, anyio, stack-data, pandas, matplotlib, jupyter-server-terminals, jupyter-client, jsonschema, imbalanced-learn, arrow, argon2-cffi-bindings, statsmodels, seaborn, pandas-datareader, nbformat, login-attempt-simulator, isoduration, ipython, argon2-cffi, stock-analysis, nbclient, ml-utils, ipykernel, nbconvert, jupyter-events, jupyter-server, notebook-shim, nbclassic, notebook, jupyterlab-server, jupyterlab
DEPRECATION: sqlalchemy is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at pypa/pip#8559
Running setup.py install for sqlalchemy ... done
DEPRECATION: scipy is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at pypa/pip#8559
Running setup.py install for scipy ... error
error: subprocess-exited-with-error

× Running setup.py install for scipy did not run successfully.
│ exit code: 1
╰─> [137 lines of output]

  Note: if you need reliable uninstall behavior, then install
  with pip instead of using `setup.py install`:
  
    - `pip install .`       (from a git repo or downloaded source
                             release)
    - `pip install scipy`   (last SciPy release on PyPI)
  
  
  Running from scipy source directory.
  lapack_opt_info:
  lapack_mkl_info:
  customize UnixCCompiler
    libraries mkl_rt not found in ['/Users/Hilary/Files/Programming/Python/Hands-On-Data-Analysis-with-Pandas/book_env/lib', '/usr/local/lib', '/usr/lib']
    NOT AVAILABLE
  
  openblas_lapack_info:
  customize UnixCCompiler
  customize UnixCCompiler
    libraries openblas not found in ['/Users/Hilary/Files/Programming/Python/Hands-On-Data-Analysis-with-Pandas/book_env/lib', '/usr/local/lib', '/usr/lib']
    NOT AVAILABLE
  
  openblas_clapack_info:
  customize UnixCCompiler
  customize UnixCCompiler
    libraries openblas,lapack not found in ['/Users/Hilary/Files/Programming/Python/Hands-On-Data-Analysis-with-Pandas/book_env/lib', '/usr/local/lib', '/usr/lib']
    NOT AVAILABLE
  
  atlas_3_10_threads_info:
  Setting PTATLAS=ATLAS
  customize UnixCCompiler
    libraries lapack_atlas not found in /Users/Hilary/Files/Programming/Python/Hands-On-Data-Analysis-with-Pandas/book_env/lib
  customize UnixCCompiler
    libraries tatlas,tatlas not found in /Users/Hilary/Files/Programming/Python/Hands-On-Data-Analysis-with-Pandas/book_env/lib
  customize UnixCCompiler
    libraries lapack_atlas not found in /usr/local/lib
  customize UnixCCompiler
    libraries tatlas,tatlas not found in /usr/local/lib
  customize UnixCCompiler
    libraries lapack_atlas not found in /usr/lib
  customize UnixCCompiler
    libraries tatlas,tatlas not found in /usr/lib
  <class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
    NOT AVAILABLE
  
  atlas_3_10_info:
  customize UnixCCompiler
    libraries lapack_atlas not found in /Users/Hilary/Files/Programming/Python/Hands-On-Data-Analysis-with-Pandas/book_env/lib
  customize UnixCCompiler
    libraries satlas,satlas not found in /Users/Hilary/Files/Programming/Python/Hands-On-Data-Analysis-with-Pandas/book_env/lib
  customize UnixCCompiler
    libraries lapack_atlas not found in /usr/local/lib
  customize UnixCCompiler
    libraries satlas,satlas not found in /usr/local/lib
  customize UnixCCompiler
    libraries lapack_atlas not found in /usr/lib
  customize UnixCCompiler
    libraries satlas,satlas not found in /usr/lib
  <class 'numpy.distutils.system_info.atlas_3_10_info'>
    NOT AVAILABLE
  
  atlas_threads_info:
  Setting PTATLAS=ATLAS
  customize UnixCCompiler
    libraries lapack_atlas not found in /Users/Hilary/Files/Programming/Python/Hands-On-Data-Analysis-with-Pandas/book_env/lib
  customize UnixCCompiler
    libraries ptf77blas,ptcblas,atlas not found in /Users/Hilary/Files/Programming/Python/Hands-On-Data-Analysis-with-Pandas/book_env/lib
  customize UnixCCompiler
    libraries lapack_atlas not found in /usr/local/lib
  customize UnixCCompiler
    libraries ptf77blas,ptcblas,atlas not found in /usr/local/lib
  customize UnixCCompiler
    libraries lapack_atlas not found in /usr/lib
  customize UnixCCompiler
    libraries ptf77blas,ptcblas,atlas not found in /usr/lib
  <class 'numpy.distutils.system_info.atlas_threads_info'>
    NOT AVAILABLE
  
  atlas_info:
  customize UnixCCompiler
    libraries lapack_atlas not found in /Users/Hilary/Files/Programming/Python/Hands-On-Data-Analysis-with-Pandas/book_env/lib
  customize UnixCCompiler
    libraries f77blas,cblas,atlas not found in /Users/Hilary/Files/Programming/Python/Hands-On-Data-Analysis-with-Pandas/book_env/lib
  customize UnixCCompiler
    libraries lapack_atlas not found in /usr/local/lib
  customize UnixCCompiler
    libraries f77blas,cblas,atlas not found in /usr/local/lib
  customize UnixCCompiler
    libraries lapack_atlas not found in /usr/lib
  customize UnixCCompiler
    libraries f77blas,cblas,atlas not found in /usr/lib
  <class 'numpy.distutils.system_info.atlas_info'>
    NOT AVAILABLE
  
  accelerate_info:
    NOT AVAILABLE
  
  /Users/Hilary/Files/Programming/Python/Hands-On-Data-Analysis-with-Pandas/book_env/lib/python3.8/site-packages/numpy/distutils/system_info.py:638: UserWarning:
      Atlas (http://math-atlas.sourceforge.net/) libraries not found.
      Directories to search for the libraries can be specified in the
      numpy/distutils/site.cfg file (section [atlas]) or by setting
      the ATLAS environment variable.
    self.calc_info()
  lapack_info:
  customize UnixCCompiler
    libraries lapack not found in ['/Users/Hilary/Files/Programming/Python/Hands-On-Data-Analysis-with-Pandas/book_env/lib', '/usr/local/lib', '/usr/lib']
    NOT AVAILABLE
  
  /Users/Hilary/Files/Programming/Python/Hands-On-Data-Analysis-with-Pandas/book_env/lib/python3.8/site-packages/numpy/distutils/system_info.py:638: UserWarning:
      Lapack (http://www.netlib.org/lapack/) libraries not found.
      Directories to search for the libraries can be specified in the
      numpy/distutils/site.cfg file (section [lapack]) or by setting
      the LAPACK environment variable.
    self.calc_info()
  lapack_src_info:
    NOT AVAILABLE
  
  /Users/Hilary/Files/Programming/Python/Hands-On-Data-Analysis-with-Pandas/book_env/lib/python3.8/site-packages/numpy/distutils/system_info.py:638: UserWarning:
      Lapack (http://www.netlib.org/lapack/) sources not found.
      Directories to search for the sources can be specified in the
      numpy/distutils/site.cfg file (section [lapack_src]) or by setting
      the LAPACK_SRC environment variable.
    self.calc_info()
    NOT AVAILABLE
  
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "/private/var/folders/1h/xsc0xzkn5lgbrfws7879hf1m0000gr/T/pip-install-3ltlcucq/scipy_0c71cff40f1340278b78b849206e7a79/setup.py", line 492, in <module>
      setup_package()
    File "/private/var/folders/1h/xsc0xzkn5lgbrfws7879hf1m0000gr/T/pip-install-3ltlcucq/scipy_0c71cff40f1340278b78b849206e7a79/setup.py", line 488, in setup_package
      setup(**metadata)
    File "/Users/Hilary/Files/Programming/Python/Hands-On-Data-Analysis-with-Pandas/book_env/lib/python3.8/site-packages/numpy/distutils/core.py", line 137, in setup
      config = configuration()
    File "/private/var/folders/1h/xsc0xzkn5lgbrfws7879hf1m0000gr/T/pip-install-3ltlcucq/scipy_0c71cff40f1340278b78b849206e7a79/setup.py", line 395, in configuration
      raise NotFoundError(msg)
  numpy.distutils.system_info.NotFoundError: No lapack/blas resources found. Note: Accelerate is no longer supported.
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> scipy

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
(book_env) HouseShare-MacBook-Pro:Hands-On-Data-Analysis-with-Pandas Hilary$ pip install scipy==1.2.1
Collecting scipy==1.2.1
Using cached scipy-1.2.1.tar.gz (23.1 MB)
Preparing metadata (setup.py) ... done
Installing collected packages: scipy
DEPRECATION: scipy is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at pypa/pip#8559
Running setup.py install for scipy ... error
error: subprocess-exited-with-error

× Running setup.py install for scipy did not run successfully.
│ exit code: 1
╰─> [137 lines of output]

  Note: if you need reliable uninstall behavior, then install
  with pip instead of using `setup.py install`:
  
    - `pip install .`       (from a git repo or downloaded source
                             release)
    - `pip install scipy`   (last SciPy release on PyPI)
  
  
  Running from scipy source directory.
  lapack_opt_info:
  lapack_mkl_info:
  customize UnixCCompiler
    libraries mkl_rt not found in ['/Users/Hilary/Files/Programming/Python/Hands-On-Data-Analysis-with-Pandas/book_env/lib', '/usr/local/lib', '/usr/lib']
    NOT AVAILABLE
  
  openblas_lapack_info:
  customize UnixCCompiler
  customize UnixCCompiler
    libraries openblas not found in ['/Users/Hilary/Files/Programming/Python/Hands-On-Data-Analysis-with-Pandas/book_env/lib', '/usr/local/lib', '/usr/lib']
    NOT AVAILABLE
  
  openblas_clapack_info:
  customize UnixCCompiler
  customize UnixCCompiler
    libraries openblas,lapack not found in ['/Users/Hilary/Files/Programming/Python/Hands-On-Data-Analysis-with-Pandas/book_env/lib', '/usr/local/lib', '/usr/lib']
    NOT AVAILABLE
  
  atlas_3_10_threads_info:
  Setting PTATLAS=ATLAS
  customize UnixCCompiler
    libraries lapack_atlas not found in /Users/Hilary/Files/Programming/Python/Hands-On-Data-Analysis-with-Pandas/book_env/lib
  customize UnixCCompiler
    libraries tatlas,tatlas not found in /Users/Hilary/Files/Programming/Python/Hands-On-Data-Analysis-with-Pandas/book_env/lib
  customize UnixCCompiler
    libraries lapack_atlas not found in /usr/local/lib
  customize UnixCCompiler
    libraries tatlas,tatlas not found in /usr/local/lib
  customize UnixCCompiler
    libraries lapack_atlas not found in /usr/lib
  customize UnixCCompiler
    libraries tatlas,tatlas not found in /usr/lib
  <class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
    NOT AVAILABLE
  
  atlas_3_10_info:
  customize UnixCCompiler
    libraries lapack_atlas not found in /Users/Hilary/Files/Programming/Python/Hands-On-Data-Analysis-with-Pandas/book_env/lib
  customize UnixCCompiler
    libraries satlas,satlas not found in /Users/Hilary/Files/Programming/Python/Hands-On-Data-Analysis-with-Pandas/book_env/lib
  customize UnixCCompiler
    libraries lapack_atlas not found in /usr/local/lib
  customize UnixCCompiler
    libraries satlas,satlas not found in /usr/local/lib
  customize UnixCCompiler
    libraries lapack_atlas not found in /usr/lib
  customize UnixCCompiler
    libraries satlas,satlas not found in /usr/lib
  <class 'numpy.distutils.system_info.atlas_3_10_info'>
    NOT AVAILABLE
  
  atlas_threads_info:
  Setting PTATLAS=ATLAS
  customize UnixCCompiler
    libraries lapack_atlas not found in /Users/Hilary/Files/Programming/Python/Hands-On-Data-Analysis-with-Pandas/book_env/lib
  customize UnixCCompiler
    libraries ptf77blas,ptcblas,atlas not found in /Users/Hilary/Files/Programming/Python/Hands-On-Data-Analysis-with-Pandas/book_env/lib
  customize UnixCCompiler
    libraries lapack_atlas not found in /usr/local/lib
  customize UnixCCompiler
    libraries ptf77blas,ptcblas,atlas not found in /usr/local/lib
  customize UnixCCompiler
    libraries lapack_atlas not found in /usr/lib
  customize UnixCCompiler
    libraries ptf77blas,ptcblas,atlas not found in /usr/lib
  <class 'numpy.distutils.system_info.atlas_threads_info'>
    NOT AVAILABLE
  
  atlas_info:
  customize UnixCCompiler
    libraries lapack_atlas not found in /Users/Hilary/Files/Programming/Python/Hands-On-Data-Analysis-with-Pandas/book_env/lib
  customize UnixCCompiler
    libraries f77blas,cblas,atlas not found in /Users/Hilary/Files/Programming/Python/Hands-On-Data-Analysis-with-Pandas/book_env/lib
  customize UnixCCompiler
    libraries lapack_atlas not found in /usr/local/lib
  customize UnixCCompiler
    libraries f77blas,cblas,atlas not found in /usr/local/lib
  customize UnixCCompiler
    libraries lapack_atlas not found in /usr/lib
  customize UnixCCompiler
    libraries f77blas,cblas,atlas not found in /usr/lib
  <class 'numpy.distutils.system_info.atlas_info'>
    NOT AVAILABLE
  
  accelerate_info:
    NOT AVAILABLE
  
  /Users/Hilary/Files/Programming/Python/Hands-On-Data-Analysis-with-Pandas/book_env/lib/python3.8/site-packages/numpy/distutils/system_info.py:638: UserWarning:
      Atlas (http://math-atlas.sourceforge.net/) libraries not found.
      Directories to search for the libraries can be specified in the
      numpy/distutils/site.cfg file (section [atlas]) or by setting
      the ATLAS environment variable.
    self.calc_info()
  lapack_info:
  customize UnixCCompiler
    libraries lapack not found in ['/Users/Hilary/Files/Programming/Python/Hands-On-Data-Analysis-with-Pandas/book_env/lib', '/usr/local/lib', '/usr/lib']
    NOT AVAILABLE
  
  /Users/Hilary/Files/Programming/Python/Hands-On-Data-Analysis-with-Pandas/book_env/lib/python3.8/site-packages/numpy/distutils/system_info.py:638: UserWarning:
      Lapack (http://www.netlib.org/lapack/) libraries not found.
      Directories to search for the libraries can be specified in the
      numpy/distutils/site.cfg file (section [lapack]) or by setting
      the LAPACK environment variable.
    self.calc_info()
  lapack_src_info:
    NOT AVAILABLE
  
  /Users/Hilary/Files/Programming/Python/Hands-On-Data-Analysis-with-Pandas/book_env/lib/python3.8/site-packages/numpy/distutils/system_info.py:638: UserWarning:
      Lapack (http://www.netlib.org/lapack/) sources not found.
      Directories to search for the sources can be specified in the
      numpy/distutils/site.cfg file (section [lapack_src]) or by setting
      the LAPACK_SRC environment variable.
    self.calc_info()
    NOT AVAILABLE
  
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "/private/var/folders/1h/xsc0xzkn5lgbrfws7879hf1m0000gr/T/pip-install-9bjm8006/scipy_4ec9576068624f8fa19fc14688ae4a04/setup.py", line 492, in <module>
      setup_package()
    File "/private/var/folders/1h/xsc0xzkn5lgbrfws7879hf1m0000gr/T/pip-install-9bjm8006/scipy_4ec9576068624f8fa19fc14688ae4a04/setup.py", line 488, in setup_package
      setup(**metadata)
    File "/Users/Hilary/Files/Programming/Python/Hands-On-Data-Analysis-with-Pandas/book_env/lib/python3.8/site-packages/numpy/distutils/core.py", line 137, in setup
      config = configuration()
    File "/private/var/folders/1h/xsc0xzkn5lgbrfws7879hf1m0000gr/T/pip-install-9bjm8006/scipy_4ec9576068624f8fa19fc14688ae4a04/setup.py", line 395, in configuration
      raise NotFoundError(msg)
  numpy.distutils.system_info.NotFoundError: No lapack/blas resources found. Note: Accelerate is no longer supported.
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> scipy

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

Screenshots

Optionally, include any screenshots that will help diagnose the issue.

From an API: timedelta code incorrect in your notebook & text

you wrote:
yesterday = datetime.date.today() - datetime.timedelta(days=1)

which gives:
AttributeError: type object 'datetime.datetime' has no attribute 'timedelta'

should be:
yesterday = datetime.today() - timedelta(days=1)

and also:
'starttime': yesterday-timedelta(days=26)

pivoting with Pandas, Ch3

pd.pivot(
index=long_df.date, columns=long_df.datatype, values=long_df.temp_C
).head()

does not work on my station:

TypeError Traceback (most recent call last)
in
1 pd.pivot(
----> 2 index=long_df.date, columns=long_df.datatype, values=long_df.temp_C
3 ).head()

TypeError: pivot() missing 1 required positional argument: 'data'

Not able to install mathplotlib using requirements.txt

I'm not able to install the required packages for this book. I'm installing on Ubuntu 20.04 [edited from 19.10).

Looks like there's a problem with matplotlib:

python setup.py egg_info" failed with error code 1 in /tmp/pip-build-BqMhb7/matplotlib

I upgraded setuptool as suggested in a few spots online:

pip install --upgrade setuptools

I still got the same error above. I tried installing matplotlib manually with pip, commenting out matplotlib in the requirements.txt, but that was not a go.

Finally, decided to use my own requirements file that didn't specify versions, and it appeared to install libraries fine. Of course, checking_your_setup.ipynb is angry, but I'm going to try the exercises out, and see where we get.
`ValueError Traceback (most recent call last)
~/Repos/Hands-On-Data-Analysis-with-Pandas/ch_01/check_environment.py in run_checks()
25 try:
---> 26 pkg, version = line.split('==')
27 if pkg == 'imbalanced-learn':

ValueError: not enough values to unpack (expected 2, got 1)

During handling of the above exception, another exception occurred:

AttributeError Traceback (most recent call last)
in
1 from check_environment import run_checks
----> 2 run_checks()

~/Repos/Hands-On-Data-Analysis-with-Pandas/ch_01/check_environment.py in run_checks()
30 pkg = 'sklearn'
31 except ValueError:
---> 32 pkg = re.search(pattern, line).group(1).replace('-', '_')
33 version = None
34

AttributeError: 'NoneType' object has no attribute 'group'`

Any help to set me on a more stable track would be helpful.

Thanks!

Install of statsmodels 0.9.0 from requirements.txt fails with Python 3.8

Installing the packages in requirements.txt fails on statsmodels 0.9.0 using Python 3.8. Works fine with Python 3.6 and 3.7.

$ python3.8 -m venv venv
$ source venv/bin/activate
(venv) $ python --version
Python 3.8.3
(venv) $ pip install --upgrade pip
Collecting pip
  Using cached https://files.pythonhosted.org/packages/5a/4a/39400ff9b36e719bdf8f31c99fe1fa7842a42fa77432e584f707a5080063/pip-20.2.2-py2.py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 19.2.3
    Uninstalling pip-19.2.3:
      Successfully uninstalled pip-19.2.3
Successfully installed pip-20.2.2
(venv) $ pip install -r requirements.txt
Collecting git+https://github.com/stefmolin/login-attempt-simulator.git@pandas_book (from -r requirements.txt (line 15))
  Cloning https://github.com/stefmolin/login-attempt-simulator.git (to revision pandas_book) to /private/var/folders/rp/fw34lt290915jy32x3_l58600000gn/T/pip-req-build-bo3g65iq
Collecting git+https://github.com/stefmolin/ml-utils.git@pandas_book (from -r requirements.txt (line 16))
  Cloning https://github.com/stefmolin/ml-utils.git (to revision pandas_book) to /private/var/folders/rp/fw34lt290915jy32x3_l58600000gn/T/pip-req-build-rhx0ctdv
Collecting git+https://github.com/stefmolin/stock-analysis.git@pandas_book (from -r requirements.txt (line 17))
  Cloning https://github.com/stefmolin/stock-analysis.git (to revision pandas_book) to /private/var/folders/rp/fw34lt290915jy32x3_l58600000gn/T/pip-req-build-4us8umnm
Collecting graphviz==0.10.1
  Using cached graphviz-0.10.1-py2.py3-none-any.whl (16 kB)
Collecting imbalanced-learn==0.4.3
  Using cached imbalanced_learn-0.4.3-py3-none-any.whl (166 kB)
Collecting jupyter==1.0.0
  Using cached jupyter-1.0.0-py2.py3-none-any.whl (2.7 kB)
Collecting jupyterlab==0.35.6
  Using cached jupyterlab-0.35.6-py3-none-any.whl (14.8 MB)
Collecting matplotlib==3.0.3
  Using cached matplotlib-3.0.3.tar.gz (36.6 MB)
Collecting numpy==1.16.3
  Using cached numpy-1.16.3.zip (5.1 MB)
Collecting pandas==0.23.4
  Using cached pandas-0.23.4.tar.gz (10.5 MB)
Collecting pandas-datareader==0.7.0
  Using cached pandas_datareader-0.7.0-py2.py3-none-any.whl (111 kB)
Collecting requests==2.21.0
  Using cached requests-2.21.0-py2.py3-none-any.whl (57 kB)
Collecting scikit-learn==0.20.3
  Using cached scikit-learn-0.20.3.tar.gz (11.8 MB)
Collecting scipy==1.2.1
  Using cached scipy-1.2.1.tar.gz (23.1 MB)
Collecting seaborn==0.9.0
  Using cached seaborn-0.9.0-py3-none-any.whl (208 kB)
Collecting sqlalchemy==1.3.3
  Using cached SQLAlchemy-1.3.3.tar.gz (5.9 MB)
Collecting statsmodels==0.9.0
  Using cached statsmodels-0.9.0.tar.gz (12.7 MB)
    ERROR: Command errored out with exit status 1:
     command: /Users/ceharris/git/Hands-On-Data-Analysis-with-Pandas/venv/bin/python3.8 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/rp/fw34lt290915jy32x3_l58600000gn/T/pip-install-mj4t9vyf/statsmodels/setup.py'"'"'; __file__='"'"'/private/var/folders/rp/fw34lt290915jy32x3_l58600000gn/T/pip-install-mj4t9vyf/statsmodels/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/rp/fw34lt290915jy32x3_l58600000gn/T/pip-pip-egg-info-njuosqm7
         cwd: /private/var/folders/rp/fw34lt290915jy32x3_l58600000gn/T/pip-install-mj4t9vyf/statsmodels/
    Complete output (7 lines):
    /private/var/folders/rp/fw34lt290915jy32x3_l58600000gn/T/pip-install-mj4t9vyf/statsmodels/setup.py:477: SyntaxWarning: "is" with a literal. Did you mean "=="?
      if i is "tests":
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/rp/fw34lt290915jy32x3_l58600000gn/T/pip-install-mj4t9vyf/statsmodels/setup.py", line 347, in <module>
        from numpy.distutils.misc_util import get_info
    ModuleNotFoundError: No module named 'numpy'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

pkg-config is not installed error

Required attestation

  • I have completely and exactly followed the virtual environment setup instructions from the book.
  • I have cloned either this repository or my fork of this repository so that I have all necessary files on my local machine.
  • I have checked that this issue has not already been reported or resolved here.
  • I am aware that there is a pre-built Binder environment that I can use, but I want to install locally on my machine instead.

Background information

1. Which OS are you using?

macOS Catalina (10.15.7) on a 2020 iMac/Intel i7 iMac

2. Which Python version are you using?

v3.8.8

3. Are you using conda or venv?

I used conda to setup an environment. I also tried venv but had the same error


Commands run and their outputs

Please provide all of the commands you ran as well as the traceback:

*** NOTE: I named my env as 'book_env_c' to distinguosj it from attempts to use 'venv' ***

Step 1 : I downloaded the ZIP from GitHub and extracted locally to my Mac

Step 2 : cd /Users/**/Code/Books/Hands-On-Data-Analysis-with-Pandas-master
******@imac2 Hands-On-Data-Analysis-with-Pandas-master %

Step 3 : %conda update conda
Collecting package metadata (current_repodata.json): done
Solving environment: done

All requested packages already installed.

Step 4 : %conda create --name book_env_c python=3.8.8
Collecting package metadata (current_repodata.json): done
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: done

Package Plan

environment location: /Users/******/opt/anaconda3/envs/book_env_c

added / updated specs:
- python=3.8.8

The following NEW packages will be INSTALLED:

ca-certificates pkgs/main/osx-64::ca-certificates-2022.4.26-hecd8cb5_0
certifi pkgs/main/osx-64::certifi-2022.6.15-py38hecd8cb5_0
libcxx pkgs/main/osx-64::libcxx-12.0.0-h2f01273_0
libffi pkgs/main/osx-64::libffi-3.3-hb1e8313_2
ncurses pkgs/main/osx-64::ncurses-6.3-hca72f7f_2
openssl pkgs/main/osx-64::openssl-1.1.1p-hca72f7f_0
pip pkgs/main/osx-64::pip-21.2.4-py38hecd8cb5_0
python pkgs/main/osx-64::python-3.8.8-h88f2d9e_5
readline pkgs/main/osx-64::readline-8.1.2-hca72f7f_1
setuptools pkgs/main/osx-64::setuptools-61.2.0-py38hecd8cb5_0
sqlite pkgs/main/osx-64::sqlite-3.38.5-h707629a_0
tk pkgs/main/osx-64::tk-8.6.12-h5d9f67b_0
wheel pkgs/main/noarch::wheel-0.37.1-pyhd3eb1b0_0
xz pkgs/main/osx-64::xz-5.2.5-hca72f7f_1
zlib pkgs/main/osx-64::zlib-1.2.12-h4dc903c_2

Proceed ([y]/n)? y

Preparing transaction: done
Verifying transaction: done
Executing transaction: done

To activate this environment, use

 $ conda activate book_env_c

To deactivate an active environment, use

 $ conda deactivate

Step 5 : %conda activate book_env_c
(book_env_c) ******@imac2 Hands-On-Data-Analysis-with-Pandas-master %

Step 6 : %pip3 install -r requirements.txt
Collecting git+https://github.com/stefmolin/login-attempt-simulator.git@pandas_book (from -r requirements.txt (line 14))
Cloning https://github.com/stefmolin/login-attempt-simulator.git (to revision pandas_book) to /private/var/folders/2v/2h45q9n92bn0v3mhqqv_8wxc0000gn/T/pip-req-build-qsa8c88k
Running command git clone --filter=blob:none --quiet https://github.com/stefmolin/login-attempt-simulator.git /private/var/folders/2v/2h45q9n92bn0v3mhqqv_8wxc0000gn/T/pip-req-build-qsa8c88k
Running command git checkout -q 4e386dc47d204de95c2d2b86efd9b9c55f60ee73
Resolved https://github.com/stefmolin/login-attempt-simulator.git to commit 4e386dc47d204de95c2d2b86efd9b9c55f60ee73
Preparing metadata (setup.py) ... done
Collecting git+https://github.com/stefmolin/ml-utils.git@pandas_book (from -r requirements.txt (line 15))
Cloning https://github.com/stefmolin/ml-utils.git (to revision pandas_book) to /private/var/folders/2v/2h45q9n92bn0v3mhqqv_8wxc0000gn/T/pip-req-build-rxhb27mh
Running command git clone --filter=blob:none --quiet https://github.com/stefmolin/ml-utils.git /private/var/folders/2v/2h45q9n92bn0v3mhqqv_8wxc0000gn/T/pip-req-build-rxhb27mh
Running command git checkout -q 17934bedd6319957c698092d320ec23f4aa7e093
Resolved https://github.com/stefmolin/ml-utils.git to commit 17934bedd6319957c698092d320ec23f4aa7e093
Preparing metadata (setup.py) ... done
Collecting git+https://github.com/stefmolin/stock-analysis.git@pandas_book (from -r requirements.txt (line 16))
Cloning https://github.com/stefmolin/stock-analysis.git (to revision pandas_book) to /private/var/folders/2v/2h45q9n92bn0v3mhqqv_8wxc0000gn/T/pip-req-build-nw0j48mx
Running command git clone --filter=blob:none --quiet https://github.com/stefmolin/stock-analysis.git /private/var/folders/2v/2h45q9n92bn0v3mhqqv_8wxc0000gn/T/pip-req-build-nw0j48mx
Running command git checkout -q 9eeb9d105eb84a8bea53423378d0a8a87e2e2206
Resolved https://github.com/stefmolin/stock-analysis.git to commit 9eeb9d105eb84a8bea53423378d0a8a87e2e2206
Preparing metadata (setup.py) ... done
Collecting graphviz==0.10.1
Using cached graphviz-0.10.1-py2.py3-none-any.whl (16 kB)
Collecting imbalanced-learn==0.4.3
Using cached imbalanced_learn-0.4.3-py3-none-any.whl (166 kB)
Collecting jupyterlab==0.35.6
Using cached jupyterlab-0.35.6-py3-none-any.whl (14.8 MB)
Collecting matplotlib==3.0.3
Using cached matplotlib-3.0.3.tar.gz (36.6 MB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [44 lines of output]
IMPORTANT WARNING:
pkg-config is not installed.
matplotlib may not be able to find some of its dependencies
============================================================================
Edit setup.cfg to change the build options

  BUILDING MATPLOTLIB
              matplotlib: yes [3.0.3]
                  python: yes [3.8.8 (default, Apr 13 2021, 12:59:45)  [Clang
                          10.0.0 ]]
                platform: yes [darwin]
  
  REQUIRED DEPENDENCIES AND EXTENSIONS
                   numpy: yes [not found. pip may install it below.]
        install_requires: yes [handled by setuptools]
                  libagg: yes [pkg-config information for 'libagg' could not
                          be found. Using local copy.]
                freetype: no  [The C/C++ header for freetype2 (ft2build.h)
                          could not be found.  You may need to install the
                          development package.]
                     png: no  [pkg-config information for 'libpng' could not
                          be found.]
                   qhull: yes [pkg-config information for 'libqhull' could not
                          be found. Using local copy.]
  
  OPTIONAL SUBPACKAGES
             sample_data: yes [installing]
                toolkits: yes [installing]
                   tests: no  [skipping due to configuration]
          toolkits_tests: no  [skipping due to configuration]
  
  OPTIONAL BACKEND EXTENSIONS
                     agg: yes [installing]
                   tkagg: yes [installing; run-time loading from Python Tcl /
                          Tk]
                  macosx: yes [installing, darwin]
               windowing: no  [Microsoft Windows only]
  
  OPTIONAL PACKAGE DATA
                    dlls: no  [skipping due to configuration]
  
  ============================================================================
                          * The following required packages can not be built:
                          * freetype, png
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

Screenshots

Optionally, include any screenshots that will help diagnose the issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.