The Basics of Data Science

Okay, there are plenty of tutorials, books, etc. on the web providing an introduction to Data Science. A few I have looked at start out by setting up a suitable coding environment. They then cover the basics/details of a standard set of packages that form the basis for all work in data science using Python. E.G. NumPy, pandas, Matplotlib, Seaborn, SciPy, etc. We’ve seen a few of those in the past, but not in any real detail (well except maybe for Matplotlib). Then they get into the real work of data science. Things like statistics, regression, machine learning, etc. They tend to cover somewhat differing amounts on any of those subjects.

So, I think I am going to start working my way through one or two of them. And document what I do, find out, etc. I am hoping that by trying to sort these tutorials I may gain a better insight into my previous attempt at some statistical inference. Once again, I will do my best to avoid infringing the work of the author’s of those tutorials/books.

An essential goal of all data science work is reproducibility of the results. One of the tools used to help with that goal is Jupyter Notebooks (or as they were initially called, IPython Notebooks). There is a difference between the two. Jupyter Notebooks allow the use of (some) languages other than Python. E.G. R, another major contender in data science work. It would seem to me, clearly not the case with IPython Notebooks.

And, of course there are other science notebook packages/systems out there. But in the Python world of data science, Jupyter Notebooks are what you are most likely going to run into.

I am going to configure VS Code to work with Jupyter Notebooks.

To work with Jupyter notebooks, you must activate an Anaconda environment in VS Code, or another Python environment in which you’ve installed the Jupyter package.

– Working with Jupyter Notebooks in Visual Studio Code

I had previously installed Jupyter using pip in my global installation of Python 3.7.x. But, I think having it installed in a virtual environment rather than as a global app on my PC makes a bit more sense. I may look at removing Jupyter from that version of Python. Well, since I am primarily using conda environments at this point, eventually decided to uninstall all my global installations of Python. Crossing my fingers. Well, perhaps an unintended consquence or two. But nothing that can’t be resolved. And, now Jupyter Notebook at the command line fails.

With respect to the blog, I don’t know that I can get Hugo to present a Jupyter Notebook within the generated web page. So, I will do my initial coding in a notebook then put it into a Python module for inclusion in the post. And I will likely provide a link to the appropriate notebook for each post in this series (assuming it does become a series).

One thing I expect I will do a little differently, than some of the tutorials I looked at, is the setup of my learning environment. A number of them recommended installing the complete Anaconda package (Individual verson). But I am just not prepared to intall that behemoth, as easy as it might make things. So, I am going to stick with a (Mini)conda virtual environment. Adding the packages I need as I need them. So, let’s begin by creating a new virtual environment for this series (??) of posts. And add a few packages.

Going to be a fair bit of repetition in this post. That is, stuff I’ve done/covered in previous posts. But, practice, practice, practice…

New Conda Environment

I am going to create a new conda environment using the latest available stable version of Python (3.9 I believe). Then I am going to install some of those packages we mentioned above (though at this point not all of them). I am calling the environment ds-3.9. ds = data science, 3.9 = the python version the environment is based on.

Oh, yes! A new directory for the notebooks, modules and such I create along the way. And, a git init to create an empty Git repository. Create a new repository on GitHub. Create .gitignore and make the fist commit.

(base) PS R:\learn\py_play> cd r:\learn\ds_intro
(base) PS R:\learn\ds_intro> conda create -n ds-3.9 python=3.9
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: E:\appDev\Miniconda3\envs\ds-3.9

  added / updated specs:
    - python=3.9

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    openssl-1.1.1k             |       h2bbff1b_0         4.8 MB
    sqlite-3.35.3              |       h2bbff1b_0         761 KB
    ------------------------------------------------------------
                                           Total:         5.6 MB

The following NEW packages will be INSTALLED:

  ca-certificates    pkgs/main/win-64::ca-certificates-2021.1.19-haa95532_1
  certifi            pkgs/main/win-64::certifi-2020.12.5-py39haa95532_0
  openssl            pkgs/main/win-64::openssl-1.1.1k-h2bbff1b_0
  setuptools         pkgs/main/win-64::setuptools-52.0.0-py39haa95532_0
  sqlite             pkgs/main/win-64::sqlite-3.35.3-h2bbff1b_0
  tzdata             pkgs/main/noarch::tzdata-2020f-h52ac0ba_0
  vc                 pkgs/main/win-64::vc-14.2-h21ff451_1
  vs2015_runtime     pkgs/main/win-64::vs2015_runtime-14.27.29016-h5e58377_2
  wheel              pkgs/main/noarch::wheel-0.36.2-pyhd3eb1b0_0
  wincertstore       pkgs/main/win-64::wincertstore-0.2-py39h2bbff1b_0

Proceed ([y]/n)? y
sqlite-3.35.3        | 761 KB    | ############################################################################ | 100%
openssl-1.1.1k       | 4.8 MB    | ############################################################################ | 100%
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
#     $ conda activate ml-3.9
#
# To deactivate an active environment, use
#
(base) PS R:\learn\ds_intro> conda env list
# conda environments:
#
base                  *  E:\appDev\Miniconda3
ani-3.8                  E:\appDev\Miniconda3\envs\ani-3.8
base-3.8                 E:\appDev\Miniconda3\envs\base-3.8
ds-3.9                   E:\appDev\Miniconda3\envs\ds-3.9
flask-3.9                E:\appDev\Miniconda3\envs\flask-3.9
py30days                 E:\appDev\Miniconda3\envs\py30days

(base) PS R:\learn\ds_intro> conda activate ds-3.9
(ds-3.9) PS R:\learn\ds_intro>

Now to install some of those packages in the new data science environment. I read that if one is going to install multiple modules, it is often best to install them together. That allows conda to better sort out the various dependencies. Now I chose to only install NumPy, pandas, Matplotlib and Seaborn for the time being. SciPy and others down the road. Also when I searched for the NumPy package, the most recent version was found on conda-forge. Don’t know if it is any better or not to use Anaconda pkgs/main over conda-forge. But decided to ignore the question and let conda use whatever my current configuration suggest it use. Digging into and/or modifying that configuration was not on my menu today.

(ds-3.9) PS R:\learn\zdnet\ds_intro> conda install numpy pandas matplotlib seaborn
Collecting package metadata (current_repodata.json): done
Solving environment: |
Warning: 2 possible package resolutions (only showing differing packages):
  - defaults/win-64::libtiff-4.1.0-h56a325e_1, defaults/win-64::zstd-1.4.9-h19a0ad4_0
  - defaults/win-64::libtiff-4.2.0-hd0e1b90_0, defaults/win-64::zstd-1.4.5-h04227a9done

## Package Plan ##

  environment location: E:\appDev\Miniconda3\envs\ds-3.9

  added / updated specs:
    - matplotlib
    - numpy
    - pandas
    - seaborn

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    cycler-0.10.0              |   py39haa95532_0          16 KB
    freetype-2.10.4            |       hd328e21_0         466 KB
    intel-openmp-2020.2        |              254         1.6 MB
    kiwisolver-1.3.1           |   py39hd77b12b_0          52 KB
    libblas-3.9.0              |            8_mkl         3.9 MB  conda-forge
    libcblas-3.9.0             |            8_mkl         3.9 MB  conda-forge
    liblapack-3.9.0            |            8_mkl         3.9 MB  conda-forge
    libtiff-4.1.0              |       h56a325e_1         739 KB
    lz4-c-1.9.3                |       h2bbff1b_0         131 KB
    matplotlib-3.3.4           |   py39haa95532_0          27 KB
    matplotlib-base-3.3.4      |   py39h49ac443_0         5.1 MB
    mkl-2020.4                 |     hb70f87d_311       172.4 MB  conda-forge
    mkl-service-2.3.0          |   py39h196d8e1_0          47 KB
    numpy-1.20.2               |   py39h6635163_0         5.3 MB  conda-forge
    olefile-0.46               |             py_0          33 KB
    pandas-1.2.3               |   py39hf11a4ad_0         7.9 MB
    pillow-8.2.0               |   py39h4fa10fc_0         666 KB
    pyparsing-2.4.7            |     pyhd3eb1b0_0          59 KB
    pyqt-5.9.2                 |   py39hd77b12b_6         3.3 MB
    python-dateutil-2.8.1      |     pyhd3eb1b0_0         221 KB
    pytz-2021.1                |     pyhd3eb1b0_0         181 KB
    scipy-1.6.2                |   py39h14eb087_0        13.0 MB
    seaborn-0.11.1             |     pyhd3eb1b0_0         212 KB
    sip-4.19.13                |   py39hd77b12b_0         262 KB
    tk-8.6.10                  |       he774522_0         2.7 MB
    tornado-6.1                |   py39h2bbff1b_0         598 KB
    xz-5.2.5                   |       h62dcd97_0         244 KB
    zstd-1.4.9                 |       h19a0ad4_0         478 KB
    ------------------------------------------------------------
                                           Total:       227.2 MB

The following NEW packages will be INSTALLED:

  blas               pkgs/main/win-64::blas-1.0-mkl
  cycler             pkgs/main/win-64::cycler-0.10.0-py39haa95532_0
  freetype           pkgs/main/win-64::freetype-2.10.4-hd328e21_0
  icc_rt             pkgs/main/win-64::icc_rt-2019.0.0-h0cc432a_1
  icu                pkgs/main/win-64::icu-58.2-ha925a31_3
  intel-openmp       pkgs/main/win-64::intel-openmp-2020.2-254
  jpeg               pkgs/main/win-64::jpeg-9b-hb83a4c4_2
  kiwisolver         pkgs/main/win-64::kiwisolver-1.3.1-py39hd77b12b_0
  libblas            conda-forge/win-64::libblas-3.9.0-8_mkl
  libcblas           conda-forge/win-64::libcblas-3.9.0-8_mkl
  liblapack          conda-forge/win-64::liblapack-3.9.0-8_mkl
  libpng             pkgs/main/win-64::libpng-1.6.37-h2a8f88b_0
  libtiff            pkgs/main/win-64::libtiff-4.1.0-h56a325e_1
  lz4-c              pkgs/main/win-64::lz4-c-1.9.3-h2bbff1b_0
  matplotlib         pkgs/main/win-64::matplotlib-3.3.4-py39haa95532_0
  matplotlib-base    pkgs/main/win-64::matplotlib-base-3.3.4-py39h49ac443_0
  mkl                conda-forge/win-64::mkl-2020.4-hb70f87d_311
  mkl-service        pkgs/main/win-64::mkl-service-2.3.0-py39h196d8e1_0
  numpy              conda-forge/win-64::numpy-1.20.2-py39h6635163_0
  olefile            pkgs/main/noarch::olefile-0.46-py_0
  pandas             pkgs/main/win-64::pandas-1.2.3-py39hf11a4ad_0
  pillow             pkgs/main/win-64::pillow-8.2.0-py39h4fa10fc_0
  pyparsing          pkgs/main/noarch::pyparsing-2.4.7-pyhd3eb1b0_0
  pyqt               pkgs/main/win-64::pyqt-5.9.2-py39hd77b12b_6
  python-dateutil    pkgs/main/noarch::python-dateutil-2.8.1-pyhd3eb1b0_0
  python_abi         conda-forge/win-64::python_abi-3.9-1_cp39
  pytz               pkgs/main/noarch::pytz-2021.1-pyhd3eb1b0_0
  qt                 pkgs/main/win-64::qt-5.9.7-vc14h73c81de_0
  scipy              pkgs/main/win-64::scipy-1.6.2-py39h14eb087_0
  seaborn            pkgs/main/noarch::seaborn-0.11.1-pyhd3eb1b0_0
  sip                pkgs/main/win-64::sip-4.19.13-py39hd77b12b_0
  six                pkgs/main/win-64::six-1.15.0-py39haa95532_0
  tk                 pkgs/main/win-64::tk-8.6.10-he774522_0
  tornado            pkgs/main/win-64::tornado-6.1-py39h2bbff1b_0
  xz                 pkgs/main/win-64::xz-5.2.5-h62dcd97_0
  zlib               pkgs/main/win-64::zlib-1.2.11-h62dcd97_4
  zstd               pkgs/main/win-64::zstd-1.4.9-h19a0ad4_0

Proceed ([y]/n)? y

Downloading and Extracting Packages
pandas-1.2.3         | 7.9 MB    | ############################################################################ | 100%
python-dateutil-2.8. | 221 KB    | ############################################################################ | 100%
lz4-c-1.9.3          | 131 KB    | ############################################################################ | 100%
zstd-1.4.9           | 478 KB    | ############################################################################ | 100%
matplotlib-base-3.3. | 5.1 MB    | ############################################################################ | 100%
numpy-1.20.2         | 5.3 MB    | ############################################################################ | 100%
libtiff-4.1.0        | 739 KB    | ############################################################################ | 100%
pyparsing-2.4.7      | 59 KB     | ############################################################################ | 100%
mkl-service-2.3.0    | 47 KB     | ############################################################################ | 100%
mkl-2020.4           | 172.4 MB  | ############################################################################ | 100%
pytz-2021.1          | 181 KB    | ############################################################################ | 100%
libblas-3.9.0        | 3.9 MB    | ############################################################################ | 100%
tk-8.6.10            | 2.7 MB    | ############################################################################ | 100%
matplotlib-3.3.4     | 27 KB     | ############################################################################ | 100%
seaborn-0.11.1       | 212 KB    | ############################################################################ | 100%
scipy-1.6.2          | 13.0 MB   | ############################################################################ | 100%
intel-openmp-2020.2  | 1.6 MB    | ############################################################################ | 100%
sip-4.19.13          | 262 KB    | ############################################################################ | 100%
libcblas-3.9.0       | 3.9 MB    | ############################################################################ | 100%
olefile-0.46         | 33 KB     | ############################################################################ | 100%
tornado-6.1          | 598 KB    | ############################################################################ | 100%
kiwisolver-1.3.1     | 52 KB     | ############################################################################ | 100%
pillow-8.2.0         | 666 KB    | ############################################################################ | 100%
xz-5.2.5             | 244 KB    | ############################################################################ | 100%
pyqt-5.9.2           | 3.3 MB    | ############################################################################ | 100%
liblapack-3.9.0      | 3.9 MB    | ############################################################################ | 100%
freetype-2.10.4      | 466 KB    | ############################################################################ | 100%
cycler-0.10.0        | 16 KB     | ############################################################################ | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done

And, did you notice, SciPy came along for the ride.

(ds-3.9) PS R:\learn\ds_intro> python.exe
Python 3.9.2 (default, Mar  3 2021, 15:03:14) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import scipy
>>> version = scipy.version.version
>>> print(version)
1.6.2
>>> exit()

Okay now onto Jupyter.

Jupyter Notebook Package

In this case, chose to install from pkgs/main channel. Don’t ask why, no idea!

(ds-3.9) PS R:\learn\ds_intro> conda install -c pkgs/main jupyter
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: E:\appDev\Miniconda3\envs\ds-3.9

  added / updated specs:
    - jupyter


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    argon2-cffi-20.1.0         |   py39h2bbff1b_1          49 KB
    async_generator-1.10       |     pyhd3eb1b0_0          23 KB
    attrs-20.3.0               |     pyhd3eb1b0_0          43 KB
    backcall-0.2.0             |     pyhd3eb1b0_0          13 KB
    bleach-3.3.0               |     pyhd3eb1b0_0         113 KB
    colorama-0.4.4             |     pyhd3eb1b0_0          21 KB
    decorator-5.0.3            |     pyhd3eb1b0_0          12 KB
    defusedxml-0.7.1           |     pyhd3eb1b0_0          23 KB
    entrypoints-0.3            |   py39haa95532_0          12 KB
    importlib-metadata-3.7.3   |   py39haa95532_1          31 KB
    importlib_metadata-3.7.3   |       hd3eb1b0_1          11 KB
    ipykernel-5.3.4            |   py39h7b7c402_0         780 KB
    ipython-7.22.0             |   py39h832f523_0         1.2 MB  conda-forge
    ipython_genutils-0.2.0     |     pyhd3eb1b0_1          27 KB
    ipywidgets-7.6.3           |     pyhd3eb1b0_1         105 KB
    jedi-0.18.0                |   py39haa95532_1         912 KB
    jsonschema-3.2.0           |             py_2          47 KB
    jupyter-1.0.0              |   py39haa95532_7           8 KB
    jupyter_client-6.1.12      |     pyhd3eb1b0_0          88 KB
    jupyter_console-6.4.0      |     pyhd3eb1b0_0          23 KB
    jupyter_core-4.7.1         |   py39haa95532_0          84 KB
    jupyterlab_pygments-0.1.2  |             py_0           8 KB
    jupyterlab_widgets-1.0.0   |     pyhd3eb1b0_1         109 KB
    m2w64-gcc-libgfortran-5.3.0|                6         340 KB
    m2w64-gcc-libs-5.3.0       |                7         518 KB
    m2w64-gcc-libs-core-5.3.0  |                7         213 KB
    m2w64-gmp-6.1.0            |                2         689 KB
    m2w64-libwinpthread-git-5.0.0.4634.697f757|                2          30 KB
    mistune-0.8.4              |py39h2bbff1b_1000          57 KB
    msys2-conda-epoch-20160418 |                1           2 KB
    nbclient-0.5.3             |     pyhd3eb1b0_0          62 KB
    nbconvert-6.0.7            |   py39haa95532_0         531 KB
    nbformat-5.1.3             |     pyhd3eb1b0_0          44 KB
    nest-asyncio-1.5.1         |     pyhd3eb1b0_0          10 KB
    notebook-6.3.0             |   py39haa95532_0         4.4 MB
    packaging-20.9             |     pyhd3eb1b0_0          37 KB
    pandoc-2.12                |       haa95532_0        13.2 MB
    pandocfilters-1.4.3        |   py39haa95532_1          14 KB
    parso-0.8.2                |     pyhd3eb1b0_0          69 KB
    pickleshare-0.7.5          |  pyhd3eb1b0_1003          13 KB
    prometheus_client-0.10.0   |     pyhd3eb1b0_0          46 KB
    prompt-toolkit-3.0.17      |     pyh06a4308_0         256 KB
    prompt_toolkit-3.0.17      |       hd3eb1b0_0          12 KB
    pygments-2.8.1             |     pyhd3eb1b0_0         703 KB
    pyrsistent-0.17.3          |   py39h2bbff1b_0         120 KB
    pywin32-228                |   py39he774522_0         5.6 MB
    pywinpty-0.5.7             |   py39haa95532_0          51 KB
    pyzmq-20.0.0               |   py39hd77b12b_1         402 KB
    qtconsole-5.0.3            |     pyhd3eb1b0_0          97 KB
    qtpy-1.9.0                 |             py_0          38 KB
    send2trash-1.5.0           |     pyhd3eb1b0_1          14 KB
    terminado-0.9.4            |   py39haa95532_0          26 KB
    testpath-0.4.4             |     pyhd3eb1b0_0          85 KB
    traitlets-5.0.5            |     pyhd3eb1b0_0          81 KB
    webencodings-0.5.1         |   py39haa95532_1          20 KB
    widgetsnbextension-3.5.1   |   py39haa95532_0         867 KB
    winpty-0.4.3               |                4         678 KB
    zeromq-4.3.3               |       ha925a31_3         4.2 MB
    zipp-3.4.1                 |     pyhd3eb1b0_0          15 KB
    ------------------------------------------------------------
                                           Total:        37.0 MB

The following NEW packages will be INSTALLED:

  argon2-cffi        pkgs/main/win-64::argon2-cffi-20.1.0-py39h2bbff1b_1
  async_generator    pkgs/main/noarch::async_generator-1.10-pyhd3eb1b0_0
  attrs              pkgs/main/noarch::attrs-20.3.0-pyhd3eb1b0_0
  backcall           pkgs/main/noarch::backcall-0.2.0-pyhd3eb1b0_0
  bleach             pkgs/main/noarch::bleach-3.3.0-pyhd3eb1b0_0
  cffi               pkgs/main/win-64::cffi-1.14.5-py39hcd4344a_0
  colorama           pkgs/main/noarch::colorama-0.4.4-pyhd3eb1b0_0
  decorator          pkgs/main/noarch::decorator-5.0.3-pyhd3eb1b0_0
  defusedxml         pkgs/main/noarch::defusedxml-0.7.1-pyhd3eb1b0_0
  entrypoints        pkgs/main/win-64::entrypoints-0.3-py39haa95532_0
  importlib-metadata pkgs/main/win-64::importlib-metadata-3.7.3-py39haa95532_1
  importlib_metadata pkgs/main/noarch::importlib_metadata-3.7.3-hd3eb1b0_1
  ipykernel          pkgs/main/win-64::ipykernel-5.3.4-py39h7b7c402_0
  ipython            conda-forge/win-64::ipython-7.22.0-py39h832f523_0
  ipython_genutils   pkgs/main/noarch::ipython_genutils-0.2.0-pyhd3eb1b0_1
  ipywidgets         pkgs/main/noarch::ipywidgets-7.6.3-pyhd3eb1b0_1
  jedi               pkgs/main/win-64::jedi-0.18.0-py39haa95532_1
  jinja2             pkgs/main/noarch::jinja2-2.11.3-pyhd3eb1b0_0
  jsonschema         pkgs/main/noarch::jsonschema-3.2.0-py_2
  jupyter            pkgs/main/win-64::jupyter-1.0.0-py39haa95532_7
  jupyter_client     pkgs/main/noarch::jupyter_client-6.1.12-pyhd3eb1b0_0
  jupyter_console    pkgs/main/noarch::jupyter_console-6.4.0-pyhd3eb1b0_0
  jupyter_core       pkgs/main/win-64::jupyter_core-4.7.1-py39haa95532_0
  jupyterlab_pygmen~ pkgs/main/noarch::jupyterlab_pygments-0.1.2-py_0
  jupyterlab_widgets pkgs/main/noarch::jupyterlab_widgets-1.0.0-pyhd3eb1b0_1
  libsodium          pkgs/main/win-64::libsodium-1.0.18-h62dcd97_0
  m2w64-gcc-libgfor~ pkgs/msys2/win-64::m2w64-gcc-libgfortran-5.3.0-6
  m2w64-gcc-libs     pkgs/msys2/win-64::m2w64-gcc-libs-5.3.0-7
  m2w64-gcc-libs-co~ pkgs/msys2/win-64::m2w64-gcc-libs-core-5.3.0-7
  m2w64-gmp          pkgs/msys2/win-64::m2w64-gmp-6.1.0-2
  m2w64-libwinpthre~ pkgs/msys2/win-64::m2w64-libwinpthread-git-5.0.0.4634.697f757-2
  markupsafe         pkgs/main/win-64::markupsafe-1.1.1-py39h2bbff1b_0
  mistune            pkgs/main/win-64::mistune-0.8.4-py39h2bbff1b_1000
  msys2-conda-epoch  pkgs/msys2/win-64::msys2-conda-epoch-20160418-1
  nbclient           pkgs/main/noarch::nbclient-0.5.3-pyhd3eb1b0_0
  nbconvert          pkgs/main/win-64::nbconvert-6.0.7-py39haa95532_0
  nbformat           pkgs/main/noarch::nbformat-5.1.3-pyhd3eb1b0_0
  nest-asyncio       pkgs/main/noarch::nest-asyncio-1.5.1-pyhd3eb1b0_0
  notebook           pkgs/main/win-64::notebook-6.3.0-py39haa95532_0
  packaging          pkgs/main/noarch::packaging-20.9-pyhd3eb1b0_0
  pandoc             pkgs/main/win-64::pandoc-2.12-haa95532_0
  pandocfilters      pkgs/main/win-64::pandocfilters-1.4.3-py39haa95532_1
  parso              pkgs/main/noarch::parso-0.8.2-pyhd3eb1b0_0
  pickleshare        pkgs/main/noarch::pickleshare-0.7.5-pyhd3eb1b0_1003
  prometheus_client  pkgs/main/noarch::prometheus_client-0.10.0-pyhd3eb1b0_0
  prompt-toolkit     pkgs/main/noarch::prompt-toolkit-3.0.17-pyh06a4308_0
  prompt_toolkit     pkgs/main/noarch::prompt_toolkit-3.0.17-hd3eb1b0_0
  pycparser          pkgs/main/noarch::pycparser-2.20-py_2
  pygments           pkgs/main/noarch::pygments-2.8.1-pyhd3eb1b0_0
  pyrsistent         pkgs/main/win-64::pyrsistent-0.17.3-py39h2bbff1b_0
  pywin32            pkgs/main/win-64::pywin32-228-py39he774522_0
  pywinpty           pkgs/main/win-64::pywinpty-0.5.7-py39haa95532_0
  pyzmq              pkgs/main/win-64::pyzmq-20.0.0-py39hd77b12b_1
  qtconsole          pkgs/main/noarch::qtconsole-5.0.3-pyhd3eb1b0_0
  qtpy               pkgs/main/noarch::qtpy-1.9.0-py_0
  send2trash         pkgs/main/noarch::send2trash-1.5.0-pyhd3eb1b0_1
  terminado          pkgs/main/win-64::terminado-0.9.4-py39haa95532_0
  testpath           pkgs/main/noarch::testpath-0.4.4-pyhd3eb1b0_0
  traitlets          pkgs/main/noarch::traitlets-5.0.5-pyhd3eb1b0_0
  wcwidth            pkgs/main/noarch::wcwidth-0.2.5-py_0
  webencodings       pkgs/main/win-64::webencodings-0.5.1-py39haa95532_1
  widgetsnbextension pkgs/main/win-64::widgetsnbextension-3.5.1-py39haa95532_0
  winpty             pkgs/main/win-64::winpty-0.4.3-4
  zeromq             pkgs/main/win-64::zeromq-4.3.3-ha925a31_3
  zipp               pkgs/main/noarch::zipp-3.4.1-pyhd3eb1b0_0


Proceed ([y]/n)? y


Downloading and Extracting Packages
jsonschema-3.2.0     | 47 KB     | ############################################################################ | 100%
m2w64-gmp-6.1.0      | 689 KB    | ############################################################################ | 100%
m2w64-gcc-libs-core- | 213 KB    | ############################################################################ | 100%
zeromq-4.3.3         | 4.2 MB    | ############################################################################ | 100%
nest-asyncio-1.5.1   | 10 KB     | ############################################################################ | 100%
m2w64-libwinpthread- | 30 KB     | ############################################################################ | 100%
widgetsnbextension-3 | 867 KB    | ############################################################################ | 100%
pickleshare-0.7.5    | 13 KB     | ############################################################################ | 100%
colorama-0.4.4       | 21 KB     | ############################################################################ | 100%
jupyter_console-6.4. | 23 KB     | ############################################################################ | 100%
pywin32-228          | 5.6 MB    | ############################################################################ | 100%
nbformat-5.1.3       | 44 KB     | ############################################################################ | 100%
ipywidgets-7.6.3     | 105 KB    | ############################################################################ | 100%
pyrsistent-0.17.3    | 120 KB    | ############################################################################ | 100%
attrs-20.3.0         | 43 KB     | ############################################################################ | 100%
mistune-0.8.4        | 57 KB     | ############################################################################ | 100%
pygments-2.8.1       | 703 KB    | ############################################################################ | 100%
prompt-toolkit-3.0.1 | 256 KB    | ############################################################################ | 100%
terminado-0.9.4      | 26 KB     | ############################################################################ | 100%
ipython-7.22.0       | 1.2 MB    | ############################################################################ | 100%
ipython_genutils-0.2 | 27 KB     | ############################################################################ | 100%
pywinpty-0.5.7       | 51 KB     | ############################################################################ | 100%
jupyter_client-6.1.1 | 88 KB     | ############################################################################ | 100%
pyzmq-20.0.0         | 402 KB    | ############################################################################ | 100%
jupyterlab_pygments- | 8 KB      | ############################################################################ | 100%
qtconsole-5.0.3      | 97 KB     | ############################################################################ | 100%
jupyter-1.0.0        | 8 KB      | ############################################################################ | 100%
decorator-5.0.3      | 12 KB     | ############################################################################ | 100%
webencodings-0.5.1   | 20 KB     | ############################################################################ | 100%
async_generator-1.10 | 23 KB     | ############################################################################ | 100%
defusedxml-0.7.1     | 23 KB     | ############################################################################ | 100%
jupyterlab_widgets-1 | 109 KB    | ############################################################################ | 100%
zipp-3.4.1           | 15 KB     | ############################################################################ | 100%
traitlets-5.0.5      | 81 KB     | ############################################################################ | 100%
jedi-0.18.0          | 912 KB    | ############################################################################ | 100%
bleach-3.3.0         | 113 KB    | ############################################################################ | 100%
parso-0.8.2          | 69 KB     | ############################################################################ | 100%
importlib_metadata-3 | 11 KB     | ############################################################################ | 100%
testpath-0.4.4       | 85 KB     | ############################################################################ | 100%
prometheus_client-0. | 46 KB     | ############################################################################ | 100%
msys2-conda-epoch-20 | 2 KB      | ############################################################################ | 100%
ipykernel-5.3.4      | 780 KB    | ############################################################################ | 100%
packaging-20.9       | 37 KB     | ############################################################################ | 100%
backcall-0.2.0       | 13 KB     | ############################################################################ | 100%
pandocfilters-1.4.3  | 14 KB     | ############################################################################ | 100%
prompt_toolkit-3.0.1 | 12 KB     | ############################################################################ | 100%
entrypoints-0.3      | 12 KB     | ############################################################################ | 100%
pandoc-2.12          | 13.2 MB   | ############################################################################ | 100%
importlib-metadata-3 | 31 KB     | ############################################################################ | 100%
argon2-cffi-20.1.0   | 49 KB     | ############################################################################ | 100%
qtpy-1.9.0           | 38 KB     | ############################################################################ | 100%
nbclient-0.5.3       | 62 KB     | ############################################################################ | 100%
m2w64-gcc-libgfortra | 340 KB    | ############################################################################ | 100%
notebook-6.3.0       | 4.4 MB    | ############################################################################ | 100%
send2trash-1.5.0     | 14 KB     | ############################################################################ | 100%
nbconvert-6.0.7      | 531 KB    | ############################################################################ | 100%
winpty-0.4.3         | 678 KB    | ############################################################################ | 100%
jupyter_core-4.7.1   | 84 KB     | ############################################################################ | 100%
m2w64-gcc-libs-5.3.0 | 518 KB    | ############################################################################ | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done

Wow! Lot more than I expected. And:

(ds-3.9) PS R:\learn\ds_intro> jupyter --version
jupyter core     : 4.7.1
jupyter-notebook : 6.3.0
qtconsole        : 5.0.3
ipython          : 7.22.0
ipykernel        : 5.3.4
jupyter client   : 6.1.12
jupyter lab      : not installed
nbconvert        : 6.0.7
ipywidgets       : 7.6.3
nbformat         : 5.1.3
traitlets        : 5.0.5

And, I was able to start Jupyter and access it in my browser. As well as create an empty notebook.

(ds-3.9) PS R:\learn\ds_intro> jupyter notebook
[I 11:15:37.988 NotebookApp] Serving notebooks from local directory: R:\learn\ds_intro
[I 11:15:37.988 NotebookApp] Jupyter Notebook 6.3.0 is running at:
[I 11:15:37.988 NotebookApp] http://localhost:8888/?token=64572b9f7a03059754fc5c733666beced62053478c46505a
[I 11:15:37.988 NotebookApp]  or http://127.0.0.1:8888/?token=64572b9f7a03059754fc5c733666beced62053478c46505a
[I 11:15:37.988 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 11:15:38.468 NotebookApp]

    To access the notebook, open this file in a browser:
        file:///C:/Users/bark/AppData/Roaming/jupyter/runtime/nbserver-22192-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/?token=64572b9f7a03059754fc5c733666beced62053478c46505a
     or http://127.0.0.1:8888/?token=64572b9f7a03059754fc5c733666beced62053478c46505a
[I 11:16:18.743 NotebookApp] Creating new notebook in
[I 11:16:22.983 NotebookApp] Kernel started: 18b93252-d12a-4e58-b6e4-85f6d4e258e6, name: python3
[I 11:16:54.472 NotebookApp] Starting buffering for 18b93252-d12a-4e58-b6e4-85f6d4e258e6:4811240dad444ac58adcc0ee873b762a
[W 11:16:59.683 NotebookApp] Forbidden
[W 11:16:59.683 NotebookApp] 403 GET /api/sessions?_=1617473743118 (127.0.0.1) 0.000000ms referer=http://localhost:8888/tree
[W 11:16:59.692 NotebookApp] Forbidden
[W 11:16:59.692 NotebookApp] 403 GET /api/terminals?_=1617473743119 (127.0.0.1) 0.000000ms referer=http://localhost:8888/tree

VS Code & Jupyter

I have the Jupyter Extension for Visual Studio Code installed globally in VSCode. I don’t recall if I installed it or it was installed along with the Python extension. Not even sure if it is still required with recent changes to VSCode. But, I can’t seem to disable or uninstall it without disabling or uninstalling the Python extension. So can’t really test things out. You may need to sort this on your own.

I made sure that my new conda environment was the one selected as the interpreter in VSCode. Then I ran the Jupyter: Create New Blank Notebook command from the Command Palette (Ctrl+Shift+P).

using VSCode Command Palette to create new Jupyter Notebook

And, got the following in my VSCode window.

new, blank notebook open in VSCode window

And, when I went to save the notebook (Ctrl+S), it opened the save dialog in my workspace folder. Saved as test-1.ipynb.

save dialog window for blank notebook

Think That’s It

Well, not much in the way of anything new, but the work environment is more or less set up. So, I think I will call it quits for this post. In the next post I will take a closer look at Jupyter Notebooks before proceeding to have a look at one of the other packages we installed. Likely NumPy to start.

Resuources