Book Image

Learning Jupyter 5 - Second Edition

Book Image

Learning Jupyter 5 - Second Edition

Overview of this book

The Jupyter Notebook allows you to create and share documents that contain live code, equations, visualizations, and explanatory text. The Jupyter Notebook system is extensively used in domains such as data cleaning and transformation, numerical simulation, statistical modeling, and machine learning. Learning Jupyter 5 will help you get to grips with interactive computing using real-world examples. The book starts with a detailed overview of the Jupyter Notebook system and its installation in different environments. Next, you will learn to integrate the Jupyter system with different programming languages such as R, Python, Java, JavaScript, and Julia, and explore various versions and packages that are compatible with the Notebook system. Moving ahead, you will master interactive widgets and namespaces and work with Jupyter in a multi-user mode. By the end of this book, you will have used Jupyter with a big dataset and be able to apply all the functionalities you’ve explored throughout the book. You will also have learned all about the Jupyter Notebook and be able to start performing data transformation, numerical simulation, and data visualization.
Table of Contents (18 chapters)
Title Page
Packt Upsell
Contributors
Preface
Index

Chapter 9. Interactive Widgets

There is a mechanism for Jupyter to gather input from the user while the script is running. To do this, we put coding in the use of a widget or user interface control in the script. The widgets we will use in this chapter are defined at http://ipywidgets.readthedocs.io/en/latest/

For example, there are widgets for the following:

  • Text input: The Notebook user enters a string that will be used later in the script.
  •  Button clicks: These present the user with multiple options by way of buttons. Then, depending on which button is selected (clicked on); your script can change direction according to the user.
  • Slider: You can provide the user with a slider where the user can select a value within the range you specify, and then your script can use that value accordingly.
  • Toggle box and checkboxes: These let the user select the different options of your script that they are interested in working with.
  • Progress bar: A progress bar can be used to show how far along they are...