Jupyter Notebook It's Different!

Jupyter Notebook It's Different!

Impractical Python Jeremy Reichman @jaharmi Tamman Technologies, Inc. In [160]: %%html <iframe src="https://docs.google.com/forms/d/e/1FAIpQLScYjVXRX0yiLUD1qDyVlbYRaiH a_PZ_vuK5ol7YkUKsY4z7pw/viewform?embedded=true" width="800" height="600" framebo rder="0" marginheight="0" marginwidth="0">Loading...</iframe> PSU Mac Admins Conference 2019 Python survey This survey will ask you about Python, general scripting and programming, Apple platform administration, and stuff of that sort. It will take a minimum of 3 years to complete. I am attending the Penn State Mac Admins Conference 2019. Yes No Besides attending the conference, I am also a speaker. Yes No Not at the conference During the Krst three days of the conference, I have already Please take this survey to temporarily deflect your attention from any and all deficiencies of this session https://forms.gle/YhWXcZBsrb3LJTfr9 (https://forms.gle/YhWXcZBsrb3LJTfr9) THAT SUCKS! THAT SUCKS BIG TIME! Not a typical presentation Jupyter Notebook It's different! It looks just like this! Credit: macOS Mojave. Why you might want Python Data science! Opportunities! Keep your Mac instead of replacing it with an iPad Pro! Modern Python vs. Legacy Python JetBrains Python Dev Ecosystem 2019 (https://www.jetbrains.com/lp/devecosystem- 2019/python/) In [9]: import matplotlib.pyplot as plt In [30]: labels = ["Python 3", "Python 2"] sizes = [87, 13] explode = (0, 0.25) In [31]: plt.pie( sizes, labels=labels, startangle=90, autopct='%1.0f%%', explode=explode, ) plt.show() End of Python 2 No more updates as of January 1, 2020 Not even for security! It's dead! Credit: Marvel Studios, Avengers Endgame poster, modified. Why you might not want Python Avoiding Python 2 See "Scripting Language Runtimes" in macOS Catalina Beta Release Notes (https://developer.apple.com/documentation/macos_release_notes/macos_catalina_10_15_beta_3_release_notes) Having to install and manage Python Would one or more Mac admin-specific "distributions" of Modern Python be worthwhile? Swift, SwiftUI, and their place in Apple platforms Python 3 Redesigned Dark mode Credit: Python Software Foundation, Python logo. Also, this is NOT REAL. Getting started with Python 3 Python.org (https://python.org/) Relocatable Python (https://github.com/gregneagle/relocatable-python) "Relocatable Python framework containing PyObjC" "Ideal for embedding into an application's Frameworks directory" Anaconda (https://anaconda.org) Python plus many modules, built and tested to work together Makes Jupyter Notebook easier to use Jupyter Notebook, again Gave up all modern presentation conveniences Drag and drop Easy editing Knowing what I was doing Animations, builds, MAGIC MOVE Not sure if this is 20 minutes into the future or what Credit: ABC network Resign myself to troubleshooting my presentation environment In [4]: %%html <div align="left"> <video width="80%" controls> <source src="resources/ThisBusinessOutOfControl.mp4" type="video/mp4"> </video></div> Assumption that every "slide" is for code Which executes somewhere, wherever the "kernel" is running Credit: Jupyter Documentation. And provides for some interesting interactivity In [16]: !echo $PATH /home/nbuser/anaconda3_501/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin :/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/home/nbuser/.local/bin In [75]: !conda env list # conda environments: # base /Users/jeremy/anaconda3 anaconda3_501 * /Users/jeremy/anaconda3/envs/anaconda3_501 In [17]: !type pip pip is /home/nbuser/anaconda3_501/bin/pip In [21]: !conda list 2>/dev/null # packages in environment at /Users/jeremy/anaconda3/envs/anaconda3_501: # # Name Version Build Channel appdirs 1.4.3 py_1 conda-forge appnope 0.1.0 py37_1000 conda-forge arrow 0.14.2 py37_0 conda-forge asn1crypto 0.24.0 py37_1003 conda-forge attrs 19.1.0 py_0 conda-forge backcall 0.1.0 py_0 conda-forge backports 1.0 py_2 conda-forge binaryornot 0.4.4 py_1 conda-forge black 19.3b0 py_0 conda-forge blackcellmagic 0.0.2 pypi_0 pypi bleach 3.1.0 py_0 conda-forge bzip2 1.0.6 h1de35cc_1002 conda-forge ca-certificates 2019.5.15 0 cachetools 2.1.0 py_0 conda-forge certifi 2019.6.16 py37_0 cffi 1.12.3 py37hccf1714_0 conda-forge chardet 3.0.4 py37_1003 conda-forge click 7.0 py_0 conda-forge configparser 3.7.3 py37_1 conda-forge cookiecutter 1.6.0 py37_1000 conda-forge cryptography 2.7 py37h212c5bf_0 conda-forge csvfaker 1.0.5 pypi_0 pypi cycler 0.10.0 py37_0 dbus 1.13.6 h2f22bb5_0 conda-forge decorator 4.4.0 py_0 conda-forge defusedxml 0.5.0 py_1 conda-forge df2gspread 1.0.4 py37_1000 conda-forge editorconfig 0.12.2 pypi_0 pypi entrypoints 0.3 py37_1000 conda-forge et_xmlfile 1.0.1 py_1001 conda-forge expat 2.2.5 h6de7cb9_1003 conda-forge faker 1.0.7 py37_0 conda-forge freetype 2.9.1 hb4e5f40_0 future 0.17.1 py37_1000 conda-forge gettext 0.19.8.1 h46ab8bc_1002 conda-forge glib 2.58.3 h9d45998_1001 conda-forge google-api-python-client 1.7.9 py_0 conda-forge google-auth 1.6.3 py_0 conda-forge google-auth-httplib2 0.0.3 py_2 conda-forge gspread 3.1.0 py_0 conda-forge httplib2 0.13.0 py37_0 conda-forge icu 58.2 h0a44026_1000 conda-forge idna 2.8 py37_1000 conda-forge ipykernel 5.1.1 py37h24bf2e0_0 conda-forge ipython 7.6.1 py37h5ca1d4c_0 conda-forge ipython_genutils 0.2.0 py_1 conda-forge ipywidgets 7.5.0 py_0 conda-forge jdcal 1.4.1 py_0 conda-forge jedi 0.14.0 py37_0 conda-forge jinja2 2.10.1 py_0 conda-forge jinja2-time 0.2.0 py_2 conda-forge jpeg 9c h1de35cc_1001 conda-forge jsonschema 3.0.1 py37_0 conda-forge jupyter 1.0.0 py37_7 jupyter_client 5.2.4 py_3 conda-forge jupyter_console 6.0.0 py_0 conda-forge jupyter_contrib_core 0.3.3 py_2 conda-forge jupyter_contrib_nbextensions 0.5.1 py37_0 conda-forge jupyter_core 4.4.0 py_0 conda-forge jupyter_highlight_selected_word 0.2.0 py37_1000 conda-for ge jupyter_latex_envs 1.4.4 py37_1000 conda-forge jupyter_nbextensions_configurator 0.4.1 py37_0 conda-f orge kiwisolver 1.1.0 py37h0a44026_0 libblas 3.8.0 10_openblas conda-forge libcblas 3.8.0 10_openblas conda-forge libcxx 8.0.0 4 conda-forge libcxxabi 8.0.0 4 conda-forge libffi 3.2.1 h6de7cb9_1006 conda-forge libgfortran 3.0.1 0 conda-forge libiconv 1.15 h01d97ff_1005 conda-forge liblapack 3.8.0 10_openblas conda-forge libopenblas 0.3.6 hd44dcd8_4 conda-forge libpng 1.6.37 h2573ce8_0 conda-forge libsodium 1.0.16 h1de35cc_1001 conda-forge libxml2 2.9.9 hd80cff7_1 conda-forge libxslt 1.1.32 h1e79283_1003 conda-forge lxml 4.3.4 py37h08abf6f_0 conda-forge markupsafe 1.1.1 py37h1de35cc_0 conda-forge matplotlib 3.1.0 py37h54f8f79_0 mistune 0.8.4 py37h1de35cc_1000 conda-forge nb-conda 2.2.1 pypi_0 pypi nb_conda 2.2.1 py37_2 conda-forge nb_conda_kernels 2.2.2 py37_0 nbconvert 5.5.0 py_0 conda-forge nbformat 4.4.0 py_1 conda-forge ncurses 6.1 h0a44026_1002 conda-forge notebook 5.7.8 py37_0 numpy 1.16.4 py37h6b0580a_0 conda-forge oauth2client 4.1.3 py_0 conda-forge openblas 0.3.6 hd44dcd8_4 conda-forge openpyxl 2.6.2 py_0 conda-forge openssl 1.1.1c h1de35cc_1 pandas 0.24.2 py37h86efe34_0 conda-forge pandoc 2.7.3 0 conda-forge pandocfilters 1.4.2 py_1 conda-forge parso 0.5.0 py_0 conda-forge pcre 8.41 h0a44026_1003 conda-forge pexpect 4.7.0 py37_0 conda-forge pickleshare 0.7.5 py37_1000 conda-forge pip 19.1.1 py37_0 conda-forge poyo 0.4.2 py_0 conda-forge prometheus_client 0.7.1 py_0 conda-forge prompt_toolkit 2.0.9 py_0 conda-forge ptyprocess 0.6.0 py_1001 conda-forge pyasn1 0.4.5 py_0 conda-forge pyasn1-modules 0.2.5 py_0 conda-forge pycparser 2.19 py37_1 conda-forge pycrypto 2.6.1 py37h1de35cc_1002 conda-forge pygments 2.4.2 py_0 conda-forge pyjokes 0.5.0 py_0 conda-forge pyopenssl 19.0.0 py37_0 conda-forge pyparsing 2.4.0 py_0 pyqt 5.9.2 py37h2a560b1_0 conda-forge pyrsistent 0.15.3 py37h01d97ff_0 conda-forge pysocks 1.7.0 py37_0 conda-forge python 3.7.3 h93065d6_1 conda-forge python-dateutil 2.8.0 py_0 conda-forge python-magic 0.4.15 pypi_0 pypi pytz 2019.1 py_0 conda-forge pyyaml 5.1.1 py37h01d97ff_0 conda-forge pyzmq 18.0.2 py37h2d07e9b_0 conda-forge qt 5.9.7 h93ee506_2 conda-forge qtconsole 4.5.1 py_0 conda-forge readline 8.0 hcfe32e1_0 conda-forge requests 2.22.0 py37_0 conda-forge rise 5.5.1 py37_0 conda-forge rsa 3.4.2 py_1 conda-forge send2trash 1.5.0 py_0 conda-forge setuptools 41.0.1 py37_0 conda-forge simplejson 3.16.0 py37h1de35cc_1002 conda-forge sip 4.19.8 py37h0a44026_1000 conda-forge six 1.12.0 py37_1000 conda-forge sqlite 3.28.0 hb7d70f7_1 conda-forge tabulate 0.8.3 py_0 conda-forge terminado 0.8.2 py37_0 conda-forge testpath 0.4.2 py_1001 conda-forge text-unidecode 1.2 py_0 conda-forge tk 8.6.9 h2573ce8_1002 conda-forge toml 0.10.0 py_0 conda-forge tornado 6.0.3 py37h01d97ff_0 conda-forge traitlets 4.3.2 py37_1000 conda-forge uritemplate 3.0.0 py_1 conda-forge urllib3 1.24.3 py37_0 conda-forge wcwidth 0.1.7 py_1 conda-forge webencodings 0.5.1 py_1 conda-forge wheel 0.33.4 py37_0 conda-forge whichcraft 0.5.2 py_1 conda-forge widgetsnbextension 3.5.0 py37_0 conda-forge xz 5.2.4 h1de35cc_1001 conda-forge yaml 0.1.7 h1de35cc_1001 conda-forge youtube-dl 2019.7.2 pypi_0 pypi zeromq 4.3.1 h0a44026_1000 conda-forge zlib 1.2.11 h1de35cc_1004 conda-forge In [40]: def double(x): print(x * 2) double(42) 84 In [35]: from ipywidgets import interact def my_function(x): return x # create a slider interact(my_function, x=20) Out[35]: <function __main__.my_function(x)> In [42]: import pyjokes In [43]: pyjokes.get_joke() Out[43]: "How do you know whether a person is a Vim user? Don't worry, they'll tell y ou." And now how 1.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    101 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us