0%

Book Description

This is the eBook of the printed book and may not include any media, website access codes, or print supplements that may come packaged with the bound book.

 For introductory-level Python programming and/or data-science courses.

 

A groundbreaking, flexible approach to computer science and data science

The Deitels’ Introduction to Python for Computer Science and Data Science: Learning to Program with AI, Big Data and the Cloud offers a unique approach to teaching introductory Python programming, appropriate for both computer-science and data-science audiences. Providing the most current coverage of topics and applications, the book is paired with extensive traditional supplements as well as Jupyter Notebooks supplements. Real-world datasets and artificial-intelligence technologies allow students to work on projects making a difference in business, industry, government and academia. Hundreds of examples, exercises, projects (EEPs), and implementation case studies give students an engaging, challenging and entertaining introduction to Python programming and hands-on data science.

 

The book’s modular architecture enables instructors to conveniently adapt the text to a wide range of computer-science and data-science courses offered to audiences drawn from many majors. Computer-science instructors can integrate as much or as little data-science and artificial-intelligence topics as they’d like, and data-science instructors can integrate as much or as little Python as they’d like. The book aligns with the latest ACM/IEEE CS-and-related computing curriculum initiatives and with the Data Science Undergraduate Curriculum Proposal sponsored by the National Science Foundation.

Table of Contents

  1. Intro to Python® for Computer Science and Data Science
  2. Deitel® Series Page
  3. Intro to Python® for Computer Science and Data Science
  4. Intro to Python® for Computer Science and Data Science
  5. Contents
  6. Preface
    1. Python for Computer Science and Data Science Education
    2. Modular Architecture
    3. Audiences for the Book
    4. Key Features
    5. Chapter Dependencies
    6. Computing and Data Science Curricula
    7. Data Science Overlaps with Computer Science28
    8. Jobs Requiring Data Science Skills
    9. Jupyter Notebooks
    10. Docker
    11. Class Tested
    12. “Flipped Classroom”
    13. Special Feature: IBM Watson Analytics and Cognitive Computing
    14. Teaching Approach
    15. Software Used in the Book
    16. Python Documentation
    17. Getting Your Questions Answered
    18. Student and Instructor Supplements
    19. Instructor Supplements on Pearson’s Instructor Resource Center
    20. Instructor Examination Copies
    21. Keeping in Touch with the Authors
    22. Acknowledgments
    23. About the Authors
    24. About Deitel® & Associates, Inc.
  7. Before You Begin
  8. 1 Introduction to Computers and Python
    1. Objectives
    2. Outline
    3. 1.1 Introduction
    4. 1.2 Hardware and Software
      1. 1.2.1 Moore’s LawMoore’s Law
      2. 1.2.2 Computer Organization
        1. Input Unit
        2. Output Unit
        3. Memory Unit
        4. Arithmetic and Logic Unit (ALU)
        5. Central Processing Unit (CPU)
        6. Secondary Storage Unit
      3. Self Check for Section 1.2
    5. 1.3 Data Hierarchy
      1. Self Check
    6. 1.4 Machine Languages, Assembly Languages and High-Level Languages
      1. Self Check
    7. 1.5 Introduction to Object Technology
      1. Self Check for Section 1.5
    8. 1.6 Operating Systems
      1. Self Check for Section 1.6
    9. 1.7 Python
      1. Self Check
    10. 1.8 It’s the Libraries!It’s the Libraries!
      1. 1.8.1 Python Standard Library
      2. 1.8.2 Data-Science Libraries
      3. Self Check for Section 1.8
    11. 1.9 Other Popular Programming Languages
      1. Self Check
    12. 1.10 Test-Drive: Using IPython and Jupyter Notebooks
      1. 1.10.1 Using IPython Interactive Mode as a Calculator
        1. Entering IPython in Interactive Mode
        2. Evaluating Expressions
        3. Exiting Interactive Mode
      2. Self Check
      3. 1.10.2 Executing a Python Program Using the IPython Interpreter
        1. Changing to This Chapter’s Examples Folder
        2. Executing the Script
        3. Creating Scripts
        4. Problems That May Occur at Execution Time
      4. Self Check
      5. 1.10.3 Writing and Executing Code in a Jupyter Notebook
        1. Opening JupyterLab in Your Browser
        2. Creating a New Jupyter Notebook
        3. Renaming the Notebook
        4. Evaluating an Expression
        5. Adding and Executing Another Cell
        6. Saving the Notebook
        7. Notebooks Provided with Each Chapter’s Examples
        8. Opening and Executing an Existing Notebook
        9. Closing JupyterLab
        10. JupyterLab Tips
        11. More Information on Working with JupyterLab
      6. Self Check
    13. 1.11 Internet and World Wide Web
      1. 1.11.1 Internet: A Network of Networks
      2. 1.11.2 World Wide Web: Making the Internet User-Friendly
      3. 1.11.3 The Cloud
        1. Mashups
      4. 1.11.4 Internet of Things
      5. Self Check for Section 1.11
    14. 1.12 Software Technologies
      1. Self Check
    15. 1.13 How Big Is Big Data?
      1. Self Check
      2. 1.13.1 Big Data Analytics
      3. 1.13.2 Data Science and Big Data Are Making a Difference: Use Cases
    16. 1.14 Case Study—A Big-Data Mobile ApplicationCase Study—A Big-Data Mobile Application
    17. 1.15 Intro to Data Science: Artificial Intelligence—at the Intersection of CS and Data ScienceIntro to Data Science: Artificial Intelligence—at the Intersection of CS and Data Science
      1. Self Check
    18. Exercises
  9. 2 Introduction to Python Programming
    1. Objectives
    2. Outline
    3. 2.1 Introduction
    4. 2.2 Variables and Assignment Statements
      1. Self Check
    5. 2.3 Arithmetic
      1. Self Check
    6. 2.4 Function print and an Intro to Single- and Double-Quoted Strings
      1. Self Check
    7. 2.5 Triple-Quoted Strings
      1. Self Check
    8. 2.6 Getting Input from the User
      1. Self Check
    9. 2.7 Decision Making: The if Statement and Comparison Operators
      1. Self Check
    10. 2.8 Objects and Dynamic Typing
      1. Self Check
    11. 2.9 Intro to Data Science: Basic Descriptive Statistics
      1. Self Check
    12. 2.10 Wrap-Up
    13. Exercises
  10. 3 Control Statements and Program Development
    1. Objectives
    2. Outline
    3. 3.1 Introduction
    4. 3.2 Algorithms
      1. Self Check
    5. 3.3 Pseudocode
      1. Self Check
    6. 3.4 Control Statements
      1. Self Check
    7. 3.5 if Statement
      1. Self Check
    8. 3.6 if……else and if……elif……else Statements
      1. Self Check
    9. 3.7 while Statement
      1. Self Check
    10. 3.8 for Statement
      1. 3.8.1 Iterables, Lists and Iterators
      2. 3.8.2 Built-In range Function
        1. Off-By-One Errors
      3. Self Check
    11. 3.9 Augmented Assignments
      1. Self Check
    12. 3.10 Program Development: Sequence-Controlled Repetition
      1. 3.10.1 Requirements Statement
      2. 3.10.2 Pseudocode for the Algorithm
      3. 3.10.3 Coding the Algorithm in Python
        1. Execution Phases
        2. Initialization Phase
        3. Processing Phase
        4. Termination Phase
      4. 3.10.4 Introduction to Formatted Strings
      5. Self Check
    13. 3.11 Program Development: Sentinel-Controlled Repetition
      1. Self Check
    14. 3.12 Program Development: Nested Control Statements
      1. Self Check
    15. 3.13 Built-In Function range: A Deeper Look
      1. Self Check
    16. 3.14 Using Type Decimal for Monetary Amounts
      1. Self Check
    17. 3.15 break and continue Statements
    18. 3.16 Boolean Operators and, or and not
      1. Self Check
    19. 3.17 Intro to Data Science: Measures of Central Tendency—Mean, Median and ModeIntro to Data Science: Measures of Central Tendency—Mean, Median and Mode
      1. Self Check
    20. 3.18 Wrap-Up
    21. Exercises
  11. 4 Functions
    1. Objectives
    2. Outline
    3. 4.1 Introduction
    4. 4.2 Defining Functions
      1. Self Check
    5. 4.3 Functions with Multiple Parameters
      1. Self Check
    6. 4.4 Random-Number Generation
      1. Self Check
    7. 4.5 Case Study: A Game of Chance
      1. Self Check
    8. 4.6 Python Standard Library
      1. Self Check
    9. 4.7 math Module Functions
    10. 4.8 Using IPython Tab Completion for Discovery
      1. Self Check
    11. 4.9 Default Parameter Values
      1. Self Check
    12. 4.10 Keyword Arguments
      1. Self Check
    13. 4.11 Arbitrary Argument Lists
      1. Self Check
    14. 4.12 Methods: Functions That Belong to Objects
    15. 4.13 Scope Rules
      1. Self Check
    16. 4.14 import: A Deeper Look
      1. Self Check
    17. 4.15 Passing Arguments to Functions: A Deeper Look
      1. Self Check
    18. 4.16 Function-Call Stack
      1. Self Check
    19. 4.17 Functional-Style Programming
      1. Pure Functions
    20. 4.18 Intro to Data Science: Measures of Dispersion
      1. Self Check
    21. 4.19 Wrap-Up
    22. Exercises
  12. 5 Sequences: Lists and Tuples
    1. Objectives
    2. Outline
    3. 5.1 Introduction
    4. 5.2 Lists
      1. Self Check
    5. 5.3 Tuples
      1. Self Check
    6. 5.4 Unpacking Sequences
      1. Self Check
    7. 5.5 Sequence Slicing
      1. Self Check
    8. 5.6 del Statement
      1. Self Check
    9. 5.7 Passing Lists to Functions
      1. Self Check
    10. 5.8 Sorting Lists
      1. Self Check
    11. 5.9 Searching Sequences
      1. Self Check
    12. 5.10 Other List Methods
      1. Self Check
    13. 5.11 Simulating Stacks with Lists
      1. Self Check
    14. 5.12 List Comprehensions
      1. Self Check
    15. 5.13 Generator Expressions
      1. Self Check
    16. 5.14 Filter, Map and Reduce
      1. Self Check
    17. 5.15 Other Sequence Processing Functions
      1. Self Check
    18. 5.16 Two-Dimensional Lists
      1. Self Check
    19. 5.17 Intro to Data Science: Simulation and Static Visualizations
      1. 5.17.1 Sample Graphs for 600, 60,000 and 6,000,000 Die Rolls
      2. Self Check
      3. 5.17.2 Visualizing Die-Roll Frequencies and Percentages
        1. Launching IPython for Interactive Matplotlib Development
        2. Importing the Libraries
        3. Rolling the Die and Calculating Die Frequencies
        4. Creating the Initial Bar Plot
        5. Setting the Window Title and Labeling the x- and y-Axes
        6. Finalizing the Bar Plot
        7. Rolling Again and Updating the Bar Plot—Introducing IPython Magics
        8. Saving Snippets to a File with the %save Magic
        9. Command-Line Arguments; Displaying a Plot from a Script
      4. Self Check
    20. 5.18 Wrap-Up
    21. Exercises
      1. Exercises 5.24 through 5.26 are reasonably challenging. Once you’ve done them, you ought to be able to implement many popular card games.
  13. 6 Dictionaries and Sets
    1. Objectives
    2. Outline
    3. 6.1 Introduction
    4. 6.2 Dictionaries
      1. 6.2.1 Creating a Dictionary
        1. Determining if a Dictionary Is Empty
        2. Self Check
      2. 6.2.2 Iterating through a Dictionary
      3. Self Check
      4. 6.2.3 Basic Dictionary Operations
        1. Accessing the Value Associated with a Key
        2. Updating the Value of an Existing Key–Value Pair
        3. Adding a New Key–Value Pair
        4. Removing a Key–Value Pair
        5. Attempting to Access a Nonexistent Key
        6. Testing Whether a Dictionary Contains a Specified Key
      5. Self Check
      6. 6.2.4 Dictionary Methods keys and values
        1. Dictionary Views
        2. Converting Dictionary Keys, Values and Key–Value Pairs to Lists
        3. Processing Keys in Sorted Order
      7. Self Check
      8. 6.2.5 Dictionary Comparisons
      9. Self Check
      10. 6.2.6 Example: Dictionary of Student Grades
      11. 6.2.7 Example: Word Counts2
        1. Python Standard Library Module collections
      12. Self Check
      13. 6.2.8 Dictionary Method update
        1. 6.2.9 Dictionary Comprehensions
      14. Self Check
    5. 6.3 Sets
      1. Self Check
      2. 6.3.1 Comparing Sets
      3. Self Check
      4. 6.3.2 Mathematical Set Operations
        1. Union
        2. Intersection
        3. Difference
        4. Symmetric Difference
        5. Disjoint
      5. Self Check
      6. 6.3.3 Mutable Set Operators and Methods
        1. Mutable Mathematical Set Operations
        2. Methods for Adding and Removing Elements
        3. Self Check
      7. 6.3.4 Set Comprehensions
    6. 6.4 Intro to Data Science: Dynamic Visualizations
      1. Self Check
      2. 6.4.1 How Dynamic Visualization Works
        1. Animation Frames
        2. Running RollDieDynamic.py
        3. Sample Executions
      3. Self Check
      4. 6.4.2 Implementing a Dynamic Visualization
        1. Importing the Matplotlib animation Module
        2. Function update
        3. Function update: Rolling the Die and Updating the frequencies List
        4. Function update: Configuring the Bar Plot and Text
        5. Variables Used to Configure the Graph and Maintain State
        6. Calling the animation Module’s Module’s FuncAnimation Function
      5. Self Check
    7. 6.5 Wrap-Up
    8. Exercises
  14. 7 Array-Oriented Programming with NumPy
    1. Objectives
    2. Outline
    3. 7.1 Introduction
      1. Self Check
    4. 7.2 Creating arrays from Existing Data
      1. Self Check
    5. 7.3 array Attributes
      1. Self Check
    6. 7.4 Filling arrays with Specific Values
    7. 7.5 Creating arrays from Ranges
    8. 7.6 List vs. array Performance: Introducing %timeit
    9. 7.7 array Operators
    10. 7.8 NumPy Calculation Methods
    11. 7.9 Universal Functions
    12. 7.10 Indexing and Slicing
    13. 7.11 Views: Shallow Copies
    14. 7.12 Deep Copies
    15. 7.13 Reshaping and Transposing
    16. 7.14 Intro to Data Science: pandas Series and DataFrames
      1. 7.14.1 pandas Series
        1. Creating a Series with Default Indices
        2. Displaying a Series
        3. Creating a Series with All Elements Having the Same Value
        4. Accessing a Series’ Elements’ Elements
        5. Producing Descriptive Statistics for a Series
        6. Creating a Series with Custom Indices
        7. Dictionary Initializers
        8. Accessing Elements of a Series Via Custom Indices
        9. Creating a Series of Strings
        10. Self Check
      2. 7.14.2 DataFrames
        1. Creating a DataFrame from a Dictionary
        2. Customizing a DataFrame’s Indices with the ’s Indices with the index Attribute
        3. Accessing a DataFrame’s Columns ’s Columns
        4. Selecting Rows via the loc and iloc Attributes
        5. Selecting Rows via Slices and Lists with the loc and iloc Attributes
        6. Selecting Subsets of the Rows and Columns
        7. Boolean Indexing
        8. Accessing a Specific DataFrame Cell by Row and Column
        9. Descriptive Statistics
        10. Transposing the DataFrame with the T Attribute
        11. Sorting by Rows by Their Indices
        12. Sorting by Column Indices
        13. Sorting by Column Values
        14. Copy vs. In-Place Sorting
        15. Self Check
    17. 7.15 Wrap-Up
    18. Exercises
  15. 8 Strings: A Deeper Look
    1. Objectives
    2. Outline
    3. 8.1 Introduction
    4. 8.2 Formatting Strings
      1. 8.2.1 Presentation Types
      2. Integers
      3. Characters
      4. Strings
      5. Floating-Point and Decimal Values
      6. Self Check
      7. 8.2.2 Field Widths and Alignment
      8. Explicitly Specifying Left and Right Alignment in a Field
      9. Centering a Value in a Field
      10. Self Check
      11. 8.2.3Numeric Formatting
      12. Formatting Positive Numbers with Signs
      13. Using a Space Where a + Sign Would Appear in a Positive Value
      14. Grouping Digits
      15. Self Check
      16. 8.2.4String’s String’s format Method
      17. Multiple Placeholders
      18. Referencing Arguments By Position Number
      19. Referencing Keyword Arguments
      20. Self Check
    5. 8.3 Concatenating and Repeating Strings
    6. 8.4 Stripping Whitespace from Strings
    7. 8.5 Changing Character Case
    8. 8.6 Comparison Operators for Strings
    9. 8.7 Searching for Substrings
    10. 8.8 Replacing Substrings
    11. 8.9 Splitting and Joining Strings
    12. 8.10 Characters and Character-Testing Methods
    13. 8.11 Raw Strings
    14. 8.12 Introduction to Regular Expressions
      1. 8.12.1 re Module and Function fullmatch
        1. Matching Literal Characters
        2. Metacharacters, Character Classes and Quantifiers
        3. Other Predefined Character Classes
        4. Custom Character Classes
        5. * vs. + Quantifier
        6. Other Quantifiers
        7. Self Check
      2. 8.12.2 Replacing Substrings and Splitting Strings
        1. Function sub—Replacing Patterns —Replacing Patterns
        2. Function split
        3. Self Check
      3. 8.12.3 Other Search Functions; Accessing Matches
        1. Function search—Finding the First Match Anywhere in a String—Finding the First Match Anywhere in a String
        2. Ignoring Case with the Optional flags Keyword Argument
        3. Metacharacters That Restrict Matches to the Beginning or End of a String
        4. Function findall and finditer—Finding All Matches in a String—Finding All Matches in a String
        5. Capturing Substrings in a Match
        6. Self Check
    15. 8.13 Intro to Data Science: Pandas, Regular Expressions and Data Munging
      1. Self Check
    16. 8.14 Wrap-Up
    17. Exercises
      1. Regular Expression Exercises
      2. More Challenging String-Manipulation Exercises
  16. 9 Files and Exceptions
    1. Objectives
    2. Outline
    3. 9.1 Introduction
    4. 9.2 Files
    5. 9.3 Text-File Processing
      1. 9.3.1 Writing to a Text File: Introducing the with Statement
      2. The with Statement
      3. Built-In Function open
      4. Writing to the File
      5. Contents of accounts.txt File
      6. Self Check
      7. 9.3.2 Reading Data from a Text File
        1. File Method readlines
        2. Seeking to a Specific File Position
      8. Self Check
    6. 9.4 Updating Text Files
      1. Self Check
    7. 9.5 Serialization with JSON
      1. Self Check
    8. 9.6 Focus on Security: pickle Serialization and Deserialization
    9. 9.7 Additional Notes Regarding Files
      1. Self Check
    10. 9.8 Handling Exceptions
      1. 9.8.1 Division by Zero and Invalid Input
        1. Division By Zero
        2. Invalid Input
      2. 9.8.2 try Statements
        1. try Clause
        2. except Clause
        3. else Clause
        4. Flow of Control for a ZeroDivisionError
        5. Flow of Control for a ValueError
        6. Flow of Control for a Successful Division
      3. Self Check
      4. 9.8.3 Catching Multiple Exceptions in One except Clause
      5. 9.8.4 What Exceptions Does a Function or Method Raise?
      6. 9.8.5 What Code Should Be Placed in a try Suite?
    11. 9.9 finally Clause
      1. Self Check
    12. 9.10 Explicitly Raising an Exception
      1. Self Check
    13. 9.11 (Optional) Stack Unwinding and Tracebacks
      1. Self Check
    14. 9.12 Intro to Data Science: Working with CSV Files
      1. 9.12.1 Python Standard Library Module csv
        1. Writing to a CSV File
        2. Reading from a CSV File
        3. Caution: Commas in CSV Data Fields
        4. Caution: Missing Commas and Extra Commas in CSV Files
      2. Self Check
      3. 9.12.2 Reading CSV Files into Pandas DataFrames
        1. Datasets
        2. Working with Locally Stored CSV Files
      4. 9.12.3 Reading the Titanic Disaster Dataset
        1. Loading the Titanic Dataset via a URL
        2. Viewing Some of the Rows in the Titanic Dataset
        3. Customizing the Column Names
      5. 9.12.4 Simple Data Analysis with the Titanic Disaster Dataset
      6. 9.12.5 Passenger Age Histogram
      7. Self Check
    15. 9.13 Wrap-Up
    16. Exercises
  17. 10 Object-Oriented Programming
    1. Objectives
    2. Outline
    3. 10.1 Introduction
    4. 10.2 Custom Class Account
      1. 10.2.1 Test-Driving Class Account
        1. Importing Classes Account and Decimal
        2. Create an Account Object with a Constructor Expression
        3. Getting an Account’s Name and Balance’s Name and Balance
        4. Depositing Money into an Account
        5. Account Methods Perform Validation
      2. Self Check
      3. 10.2.2 Account Class Definition
        1. Defining a Class
        2. Initializing Account Objects: Method __init__
        3. Method deposit
      4. 10.2.3 Composition: Object References as Members of Classes
      5. Self Check
    5. 10.3 Controlling Access to Attributes
      1. Self Check
    6. 10.4 Properties for Data Access
      1. 10.4.1 Test-Driving Class Time
        1. Creating a Time Object
        2. Displaying a Time Object
        3. Getting an Attribute Via a Property
        4. Setting the Time
        5. Setting an Attribute via a Property
        6. Attempting to Set an Invalid Value
      2. Self Check
      3. 10.4.2 Class Time Definition
        1. Class Time: __init__ Method with Default Parameter Values
        2. Class Time: hour Read-Write Property
        3. Class Time: minute and second Read-Write Properties
        4. Class Time: Method set_time
        5. Class Time: Special Method __repr__
        6. Class Time: Special Method __str__
      4. Self Check
      5. 10.4.3 Class Time Definition Design Notes
        1. Interface of a Class
        2. Attributes Are Always Accessible
        3. Internal Data Representation
        4. Evolving a Class’s Implementation Details
        5. Properties
        6. Utility Methods
        7. Module datetime
      6. Self Check
    7. 10.5 Simulating “Private” AttributesSimulating “Private” Attributes
      1. Self Check
    8. 10.6 Case Study: Card Shuffling and Dealing Simulation
      1. 10.6.1 Test-Driving Classes Card and DeckOfCards
        1. Creating, Shuffling and Dealing the Cards
        2. Dealing Cards
        3. Class Card’s Other Features
      2. 10.6.2 Class Card—Introducing Class Attributes—Introducing Class Attributes
        1. Class Attributes FACES and SUITS
        2. Card Method __init__
        3. Read-Only Properties face, suit and image_name
        4. Methods That Return String Representations of a Card
      3. 10.6.3 Class DeckOfCards
        1. Method __init__
        2. Method shuffle
        3. Method deal_card
        4. Method __str__
      4. 10.6.4 Displaying Card Images with Matplotlib
        1. Enable Matplotlib in IPython
        2. Create the Base Path for Each Image
        3. Import the Matplotlib Features
        4. Create the Figure and Axes Objects
        5. Configure the Axes Objects and Display the Images
        6. Maximize the Image Sizes
        7. Shuffle and Re-Deal the Deck
      5. Self Check
    9. 10.7 Inheritance: Base Classes and Subclasses
      1. Self Check
    10. 10.8 Building an Inheritance Hierarchy; Introducing Polymorphism
      1. 10.8.1 Base Class CommissionEmployee
        1. All Classes Inherit Directly or Indirectly from Class object
        2. Testing Class CommissionEmployee
      2. Self Check
      3. 10.8.2 Subclass SalariedCommissionEmployee
        1. Declaring Class SalariedCommissionEmployee
        2. Inheriting from Class CommissionEmployee
        3. Method __init__ and Built-In Function super
        4. Overriding Method earnings
        5. Overriding Method __repr__
        6. Testing Class SalariedCommissionEmployee
        7. Testing the “is a” Relationship
      4. Self Check
      5. 10.8.3 Processing CommissionEmployees and SalariedCommissionEmployees Polymorphically
      6. Self Check
      7. 10.8.4A Note About Object-Based and Object-Oriented Programming
    11. 10.9 Duck Typing and Polymorphism
    12. 10.10 Operator Overloading
      1. Operator Overloading Restrictions
      2. Complex Numbers
      3. 10.10.1 Test-Driving Class Complex
      4. 10.10.2 Class Complex Definition
      5. Method __init__
      6. Overloaded + Operator
      7. Overloaded += Augmented Assignment
      8. Method __repr__
      9. Self Check
    13. 10.11 Exception Class Hierarchy and Custom Exceptions
    14. 10.12 Named Tuples
      1. Self Check
    15. 10.13 A Brief Intro to Python 3.7’s New Data ClassesA Brief Intro to Python 3.7’s New Data Classes
      1. 10.13.1 Creating a Card Data Class
        1. Importing from the dataclasses and typing Modules
        2. Using the @dataclass Decorator
        3. Variable Annotations: Class Attributes
        4. Variable Annotations: Data Attributes
        5. Defining a Property and Other Methods
        6. Variable Annotation Notes
      2. Self Check
      3. 10.13.2 Using the Card Data Class
      4. Self Check
      5. 10.13.3 Data Class Advantages over Named Tuples
      6. 10.13.4 Data Class Advantages over Traditional Classes
        1. More Information
    16. 10.14 Unit Testing with Docstrings and doctest
      1. Self Check
    17. 10.15 Namespaces and Scopes
    18. 10.16 Intro to Data Science: Time Series and Simple Linear Regression
      1. Self Check
    19. 10.17 Wrap-Up
    20. Exercises
  18. 11 Computer Science Thinking: Recursion, Searching, Sorting and Big O
    1. Objectives
    2. Outline
    3. 11.1 Introduction
    4. 11.2 Factorials
    5. 11.3 Recursive Factorial Example
      1. Self Check
    6. 11.4 Recursive Fibonacci Series Example
      1. Self Check
    7. 11.5 Recursion vs. Iteration
    8. 11.6 Self Check
    9. 11.6 Searching and Sorting
    10. 11.7 Linear Search
      1. Self Check
    11. 11.8 Efficiency of Algorithms: Big O
      1. Self Check
    12. 11.9 Binary Search
      1. Self Check
      2. 11.9.1 Binary Search Implementation
        1. Function binary_search
        2. Function remaining_elements
        3. Function main
      3. 11.9.2 Big O of the Binary Search
    13. 11.10 Sorting Algorithms
    14. 11.11 Selection Sort
      1. 11.11.1 Selection Sort Implementation
        1. Function selection_sort
        2. Function main
      2. 11.11.2 Utility Function print_pass
      3. 11.11.3 Big O of the Selection Sort
      4. Self Check
    15. 11.12 Insertion Sort
      1. 11.12.1 Insertion Sort Implementation
        1. Function insertion_sort
      2. 11.12.2 Big O of the Insertion Sort
      3. Self Check
    16. 11.13 Merge Sort
      1. 11.13.1 Merge Sort Implementation
        1. Function merge_sort
        2. Recursive Function sort_array
        3. Function merge
        4. Function subarray_string
        5. Function main
      2. 11.13.2 Big O of the Merge Sort
      3. Self Check
    17. 11.14 Big O Summary for This Chapter’s Searching and Sorting AlgorithmsBig O Summary for This Chapter’s Searching and Sorting Algorithms
    18. 11.15 Visualizing Algorithms
      1. 11.15.1 Generator Functions
        1. yield Statements
      2. 11.15.2 Implementing the Selection Sort Animation
        1. import Statements
        2. update Function That Displays Each Animation Frame
        3. flash_bars Function That Flashes the Bars About to Be Swapped
        4. selection_sort Generator Function
        5. main Function That Launches the Animation
        6. Sound Utility Functions
    19. 11.16 Wrap-Up
    20. Exercises
  19. 12 Natural Language Processing (NLP)
    1. Objectives
    2. Outline
    3. 12.1 Introduction
    4. 12.2 TextBlob1
      1. Self Check
      2. 12.2.1 Create a TextBlob
      3. Self Check
      4. 12.2.2 Tokenizing Text into Sentences and Words
      5. Self Check
      6. 12.2.3 Parts-of-Speech Tagging
      7. Self Check
      8. 12.2.4 Extracting Noun Phrases
      9. Self Check
      10. 12.2.5 Sentiment Analysis with TextBlob’s Default Sentiment AnalyzerSentiment Analysis with TextBlob’s Default Sentiment Analyzer
        1. Getting the Sentiment of a TextBlob
        2. Getting the polarity and subjectivity from the Sentiment Object
        3. Getting the Sentiment of a Sentence
      11. Self Check
      12. 12.2.6 Sentiment Analysis with the NaiveBayesAnalyzer
      13. Self Check
      14. 12.2.7 Language Detection and Translation
      15. Self Check
      16. 12.2.8 Inflection: Pluralization and Singularization
      17. Self Check
      18. 12.2.9 Spell Checking and Correction
      19. Self Check
      20. 12.2.10 Normalization: Stemming and Lemmatization
      21. Self Check
      22. 12.2.11 Word Frequencies
      23. Self Check
      24. 12.2.12 Getting Definitions, Synonyms and Antonyms from WordNet
        1. Getting Definitions
        2. Getting Synonyms
        3. Getting Antonyms
      25. Self Check
      26. 12.2.13 Deleting Stop Words
      27. Self Check
      28. 12.2.14 n-grams
      29. Self Check
    5. 12.3 Visualizing Word Frequencies with Bar Charts and Word Clouds
      1. 12.3.1 Visualizing Word Frequencies with Pandas
        1. Loading the Data
        2. Getting the Word Frequencies
        3. Eliminating the Stop Words
        4. Sorting the Words by Frequency
        5. Getting the Top 20 Words
        6. Convert top20 to a DataFrame
        7. Visualizing the DataFrame
      2. 12.3.2 Visualizing Word Frequencies with Word Clouds
        1. Installing the wordcloud Module
        2. Loading the Text
        3. Loading the Mask Image that Specifies the Word Cloud’s Shape
        4. Configuring the WordCloud Object
        5. Generating the Word Cloud
        6. Saving the Word Cloud as an Image File
        7. Generating a Word Cloud from a Dictionary
        8. Displaying the Image with Matplotlib
      3. Self Check
    6. 12.4 Readability Assessment with Textatistic
      1. Self Check
    7. 12.5 Named Entity Recognition with spaCy
      1. Self Check
    8. 12.6 Similarity Detection with spaCy
      1. Self Check
    9. 12.7 Other NLP Libraries and Tools
    10. 12.8 Machine Learning and Deep Learning Natural Language Applications
    11. 12.9 Natural Language Datasets
    12. 12.10 Wrap-Up
    13. Exercises
  20. 13 Data Mining Twitter
    1. Objectives
    2. Outline
    3. 13.1 Introduction
      1. Self Check
    4. 13.2 Overview of the Twitter APIs
      1. Self Check
    5. 13.3 Creating a Twitter Account
    6. 13.4 Getting Twitter Credentials—Creating an AppGetting Twitter Credentials—Creating an App
      1. Self Check
    7. 13.5 What’s in a Tweet?What’s in a Tweet?
      1. Key Properties of a Tweet Object
      2. Sample Tweet JSON
      3. Twitter JSON Object Resources
      4. Self Check
    8. 13.6 Tweepy
    9. 13.7 Authenticating with Twitter Via Tweepy
      1. Self Check
    10. 13.8 Getting Information About a Twitter Account
      1. Self Check
    11. 13.9 Introduction to Tweepy Cursors: Getting an Account’s Followers and Friendss: Getting an Account’s Followers and Friends
      1. 13.9.1 Determining an Account’s Followers Determining an Account’s Followers
        1. Creating a Cursor
        2. Getting Results
        3. Automatic Paging
        4. Getting Follower IDs Rather Than Followers
      2. Self Check
      3. 13.9.2 Determining Whom an Account Follows
        1. Self Check
      4. 13.9.3 Getting a User’s Recent TweetsGetting a User’s Recent Tweets
        1. Grabbing Recent Tweets from Your Own Timeline
      5. Self Check
    12. 13.10 Searching Recent Tweets
    13. 13.11 Spotting Trends: Twitter Trends API
      1. 13.11.1 Places with Trending Topics
      2. Self Check
      3. 13.11.2 Getting a List of Trending Topics
        1. Worldwide Trending Topics
        2. New York City Trending Topics
      4. Self Check
      5. 13.11.3 Create a Word Cloud from Trending Topics
      6. Self Check
    14. 13.12 Cleaning/Preprocessing Tweets for Analysis
      1. Self Check
    15. 13.13 Twitter Streaming API
      1. 13.13.1 Creating a Subclass of StreamListener
        1. Class TweetListener
        2. Class TweetListener: __init__ Method
        3. Class TweetListener: on_connect Method
        4. Class TweetListener: on_status Method
      2. 13.13.2 Initiating Stream Processing
        1. Authenticating
        2. Creating a TweetListener
        3. Creating a Stream
        4. Starting the Tweet Stream
        5. Asynchronous vs. Synchronous Streams
        6. Other filter Method Parameters
        7. Twitter Restrictions Note
      3. Self Check
    16. 13.14 Tweet Sentiment Analysis
    17. 13.15 Geocoding and Mapping
      1. Self Check
      2. 13.15.1 Getting and Mapping the Tweets
        1. Get the API Object
        2. Collections Required By LocationListener
        3. Creating the LocationListener
        4. Configure and Start the Stream of Tweets
        5. Displaying the Location Statistics
        6. Geocoding the Locations
        7. Displaying the Bad Location Statistics
        8. Cleaning the Data
        9. Creating a Map with Folium
        10. Creating Popup Markers for the Tweet Locations
        11. Saving the Map
      3. Self Check
      4. 13.15.2 Utility Functions in tweetutilities.py
        1. get_tweet_content Utility Function
        2. get_geocodes Utility Function
      5. Self Check
      6. 13.15.3 Class LocationListener
    18. 13.16 Ways to Store Tweets
    19. 13.17 Twitter and Time Series
    20. 13.18 Wrap-Up
    21. Exercises
  21. 14 IBM Watson and Cognitive Computing
    1. Outline
    2. 14.1 Introduction: IBM Watson and Cognitive Computing
      1. Self Check
    3. 14.2 IBM Cloud Account and Cloud Console
      1. Self Check
    4. 14.3 Watson Services
      1. Watson Assistant
      2. Visual Recognition
      3. Speech to Text
      4. Text to Speech
      5. Language Translator
      6. Natural Language Understanding
      7. Discovery
      8. Personality Insights
      9. Tone Analyzer
      10. Natural Language Classifier
      11. Synchronous and Asynchronous Capabilities
      12. Self Check
    5. 14.4 Additional Services and Tools
      1. Watson Studio
      2. Knowledge Studio
      3. Machine Learning
      4. Knowledge Catalog
      5. Cognos Analytics
      6. Self Check
    6. 14.5 Watson Developer Cloud Python SDK
      1. Modules We’ll Need for Audio Recording and Playback
      2. SDK Examples
      3. Self Check
    7. 14.6 Case Study: Traveler’s Companion Translation AppCase Study: Traveler’s Companion Translation App
      1. Self Check
        1. 14.6.1 Before You Run the App
        2. Registering for the Speech to Text Service
        3. Registering for the Text to Speech Service
        4. Registering for the Language Translator Service
        5. Retrieving Your Credentials
        6. Self Check
      2. 14.6.2 Test-Driving the App
        1. Processing the Question
        2. Processing the Response
        3. Self Check
      3. 14.6.3 SimpleLanguageTranslator.py Script Walkthrough
        1. Importing Watson SDK Classes
        2. Other Imported Modules
        3. Main Program: Function run_translator
        4. Function speech_to_text
        5. Function translate
        6. Function text_to_speech
        7. Function record_audio
        8. Function play_audio
        9. Executing the run_translator Function
      4. Self Check
    8. 14.7 Watson Resources
      1. Self Check
    9. 14.8 Wrap-Up
    10. Exercises
  22. 15 Machine Learning: Classification, Regression and Clustering
    1. Outline
    2. 15.1 Introduction to Machine Learning
      1. 15.1.1 Scikit-Learn
        1. Which Scikit-Learn Estimator Should You Choose for Your Project
      2. 15.1.2 Types of Machine Learning
        1. Supervised Machine Learning
        2. Datasets
        3. Classification
        4. Regression
        5. Unsupervised Machine Learning
        6. K-Means Clustering and the Iris Dataset
        7. Big Data and Big Computer Processing Power
      3. 15.1.3 Datasets Bundled with Scikit-Learn
      4. 15.1.4 Steps in a Typical Data Science Study
      5. Self Check
    3. 15.2 Case Study: Classification with k-Nearest Neighbors and the Digits Dataset, Part 1
      1. Self Check
      2. 15.2.1 k-Nearest Neighbors Algorithm
        1. Hyperparameters and Hyperparameter Tuning
        2. Self Check
      3. 15.2.2 Loading the Dataset
        1. Displaying the Description
        2. Checking the Sample and Target Sizes
        3. A Sample Digit Image
        4. Preparing the Data for Use with Scikit-Learn
        5. Self Check
      4. 15.2.3 Visualizing the Data
        1. Creating the Diagram
        2. Displaying Each Image and Removing the Axes Labels
        3. Self Check
      5. 15.2.4 Splitting the Data for Training and Testing
        1. Training and Testing Set Sizes
        2. Self Check
      6. 15.2.5 Creating the Model
      7. 15.2.6 Training the Model
      8. Self Check
      9. 15.2.7 Predicting Digit Classes
      10. Self Check
    4. 15.3 Case Study: Classification with k-Nearest Neighbors and the Digits Dataset, Part 2
      1. 15.3.1 Metrics for Model Accuracy
        1. Estimator Method score
        2. Confusion Matrix
        3. Classification Report
        4. Visualizing the Confusion Matrix
        5. Self Check
      2. 15.3.2 K-Fold Cross-Validation
        1. KFold Class
        2. Using the KFold Object with Function cross_val_score
        3. Self Check
      3. 15.3.3 Running Multiple Models to Find the Best One
        1. Scikit-Learn Estimator Diagram
        2. Self Check
      4. 15.3.4 Hyperparameter Tuning
      5. Self Check
    5. 15.4 Case Study: Time Series and Simple Linear Regression
      1. Self Check
    6. 15.5 Case Study: Multiple Linear Regression with the California Housing Dataset
      1. 15.5.1 Loading the Dataset
        1. Loading the Data
        2. Displaying the Dataset’s Description
      2. 15.5.2 Exploring the Data with Pandas
      3. Self Check
      4. 15.5.3 Visualizing the Features
      5. Self Check
      6. 15.5.4 Splitting the Data for Training and Testing
      7. 15.5.5 Training the Model
      8. Self Check
      9. 15.5.6 Testing the Model
      10. 15.5.7 Visualizing the Expected vs. Predicted Prices
      11. 15.5.8 Regression Model Metrics
      12. Self Check
      13. 15.5.9 Choosing the Best Model
    7. 15.6 Case Study: Unsupervised Machine Learning, Part 1—Dimensionality ReductionCase Study: Unsupervised Machine Learning, Part 1—Dimensionality Reduction
      1. Loading the Digits Dataset
      2. Creating a TSNE Estimator for Dimensionality Reduction
      3. Transforming the Digits Dataset’s Features into Two Dimensions
      4. Visualizing the Reduced Data
      5. Visualizing the Reduced Data with Different Colors for Each Digit
      6. Self Check
    8. 15.7 Case Study: Unsupervised Machine Learning, Part 2—k-Means ClusteringCase Study: Unsupervised Machine Learning, Part 2—k-Means Clustering
      1. Self Check
      2. 15.7.1 Loading the Iris Dataset
        1. Checking the Numbers of Samples, Features and Targets
      3. 15.7.2 Exploring the Iris Dataset: Descriptive Statistics with Pandas
      4. 15.7.3 Visualizing the Dataset with a Seaborn pairplot
        1. Displaying the pairplot in One Color
        2. Self Check
      5. 15.7.4 Using a KMeans Estimator
        1. Creating the Estimator
        2. Fitting the Model
        3. Comparing the Computer Cluster Labels to the Iris Dataset’s Target Values
        4. Self Check
      6. 15.7.5 Dimensionality Reduction with Principal Component Analysis
        1. Creating the PCA Object
        2. Transforming the Iris Dataset’s Features into Two Dimensions
        3. Visualizing the Reduced Data
        4. Self Check
      7. 15.7.6 Choosing the Best Clustering Estimator
    9. 15.8 Wrap-Up
    10. Exercises
  23. 16 Deep Learning
    1. Objectives
    2. Outline
    3. 16.1 Introduction
      1. Self Check
      2. 16.1.1 Deep Learning Applications
      3. 16.1.2 Deep Learning Demos
      4. 16.1.3 Keras Resources
    4. 16.2 Keras Built-In Datasets
    5. 16.3 Custom Anaconda Environments
      1. Self Check
    6. 16.4 Neural Networks
      1. Self Check
    7. 16.5 Tensors
      1. Self Check
    8. 16.6 Convolutional Neural Networks for Vision; Multi-Classification with the MNIST Dataset
      1. Self Check
      2. 16.6.1 Loading the MNIST Dataset
      3. Self Check
      4. 16.6.2 Data Exploration
        1. Visualizing Digits
      5. 16.6.3 Data Preparation
        1. Reshaping the Image Data
        2. Normalizing the Image Data
        3. One-Hot Encoding: Converting the Labels From Integers to Categorical Data
      6. Self Check
      7. 16.6.4 Creating the Neural Network
        1. Adding Layers to the Network
        2. Convolution
        3. Adding a Convolution Layer
        4. Dimensionality of the First Convolution Layer’s Output
        5. Overfitting
        6. Adding a Pooling Layer
        7. Adding Another Convolutional Layer and Pooling Layer
        8. Flattening the Results
        9. Adding a Dense Layer to Reduce the Number of Features
        10. Adding Another Dense Layer to Produce the Final Output
        11. Printing the Model’s Summary
        12. Visualizing a Model’s Structure
        13. Compiling the Model
      8. Self Check
      9. 16.6.5 Training and Evaluating the Model
        1. Evaluating the Model
        2. Making Predictions
        3. Locating the Incorrect Predictions
        4. Visualizing Incorrect Predictions
        5. Displaying the Probabilities for Several Incorrect Predictions
      10. Self Check
      11. 16.6.6 Saving and Loading a Model
      12. Self Check
    9. 16.7 Visualizing Neural Network Training with TensorBoard
      1. Self Check
    10. 16.8 ConvnetJS: Browser-Based Deep-Learning Training and Visualization
    11. 16.9 Recurrent Neural Networks for Sequences; Sentiment Analysis with the IMDb Dataset
      1. Self Check
      2. 16.9.1 Loading the IMDb Movie Reviews Dataset
      3. Self Check
      4. 16.9.2 Data Exploration
        1. Movie Review Encodings
        2. Decoding a Movie Review
      5. 16.9.3 Data Preparation
        1. Splitting the Test Data into Validation and Test Data
      6. Self Check
      7. 16.9.4 Creating the Neural Network
        1. Adding an Embedding Layer
        2. Adding an LSTM Layer
        3. Adding a Dense Output Layer
        4. Compiling the Model and Displaying the Summary
      8. Self Check
      9. 16.9.5 Training and Evaluating the Model
    12. 16.10 Tuning Deep Learning Models
      1. Self Check
    13. 16.11 Convnet Models Pretrained on ImageNet
    14. 16.12 Reinforcement Learning
      1. 16.12.1 Deep Q-Learning
      2. 16.12.2 OpenAI Gym
    15. 16.13 Wrap-Up
    16. Exercises
      1. Convolutional Neural Networks
      2. Recurrent Neural Networks
      3. ConvnetJS Visualization
      4. Convolutional Neural Network Projects and Research
      5. Recurrent Neural Network Projects and Research
      6. Automated Deep Learning Project
      7. Reinforcement Learning Projects and Research
      8. Generative Deep Learning
      9. Deep Fakes
      10. Additional Research
  24. 17 Big Data: Hadoop, Spark, NoSQL and IoT
    1. Objectives
    2. Outline
    3. 17.1 Introduction
      1. Self Check for Section 17.1
    4. 17.2 Relational Databases and Structured Query Language (SQL)
      1. Self Check
      2. 17.2.1 A books Database
      3. Self Check
      4. 17.2.2 SELECT Queries
      5. 17.2.3 WHERE Clause
        1. Pattern Matching: Zero or More Characters
        2. Pattern Matching: Any Character
      6. Self Check
      7. 17.2.4 ORDER BY Clause
        1. Sorting By Multiple Columns
        2. Combining the WHERE and ORDER BY Clauses
      8. Self Check
      9. 17.2.5 Merging Data from Multiple Tables: INNER JOIN
      10. Self Check
      11. 17.2.6 INSERT INTO Statement
        1. Note Regarding Strings That Contain Single Quotes
      12. 17.2.7 UPDATE Statement
      13. 17.2.8 DELETE FROM Statement
        1. Self Check for Section 17.2
    5. 17.3 NoSQL and NewSQL Big-Data Databases: A Brief Tour
      1. 17.3.1 NoSQL Key–Value DatabasesNoSQL Key–Value Databases
      2. 17.3.2 NoSQL Document Databases
      3. 17.3.3 NoSQL Columnar Databases
      4. 17.3.4 NoSQL Graph Databases
      5. 17.3.5 NewSQL Databases
      6. Self Check for Section 17.3
    6. 17.4 Case Study: A MongoDB JSON Document Database
      1. 17.4.1 Creating the MongoDB Atlas Cluster
        1. Creating Your First Database User
        2. Whitelist Your IP Address
        3. Connect to Your Cluster
      2. 17.4.2 Streaming Tweets into MongoDB
        1. Use Tweepy to Authenticate with Twitter
        2. Loading the Senators’ Data
        3. Configuring the MongoClient
        4. Setting up Tweet Stream
        5. Starting the Tweet Stream
        6. Class TweetListener
        7. Counting Tweets for Each Senator
        8. Show Tweet Counts for Each Senator
        9. Get the State Locations for Plotting Markers
        10. Grouping the Tweet Counts by State
        11. Creating the Map
        12. Creating a Choropleth to Color the Map
        13. Creating the Map Markers for Each State
        14. Displaying the Map
      3. Self Check for Section 17.4
    7. 17.5 Hadoop
      1. 17.5.1 Hadoop Overview
        1. HDFS, MapReduce and YARN
        2. Hadoop Ecosystem
        3. Hadoop Providers
        4. Hadoop 3
      2. 17.5.2 Summarizing Word Lengths in Romeo and Juliet via MapReduce
      3. 17.5.3 Creating an Apache Hadoop Cluster in Microsoft Azure HDInsight
        1. Creating an HDInsight Hadoop Cluster
      4. 17.5.4 Hadoop Streaming
      5. 17.5.5 Implementing the Mapper
      6. 17.5.6 Implementing the Reducer
      7. 17.5.7 Preparing to Run the MapReduce Example
        1. Copying the Script Files to the HDInsight Hadoop Cluster
        2. Copying RomeoAndJuliet into the Hadoop File System
      8. 17.5.8 Running the MapReduce Job
        1. Viewing the Word Counts
        2. Deleting Your Cluster So You Do Not Incur Charges
      9. Self Check for Section 17.5
    8. 17.6 Spark
      1. 17.6.1 Spark Overview
        1. History
        2. Architecture and Components
        3. Providers
      2. 17.6.2 Docker and the Jupyter Docker Stacks
        1. Docker
        2. Installing Docker
        3. Jupyter Docker Stacks
        4. Run Jupyter Docker Stack
        5. Opening JupyterLab in Your Browser
        6. Accessing the Docker Container’s Command Line
        7. Stopping and Restarting a Docker Container
      3. 17.6.3 Word Count with Spark
        1. Loading the NLTK Stop Words
        2. Configuring a SparkContext
        3. Reading the Text File and Mapping It to Words
        4. Removing the Stop Words
        5. Counting Each Remaining Word
        6. Locating Words with Counts Greater Than or Equal to 60
        7. Sorting and Displaying the Results
      4. 17.6.4 Spark Word Count on Microsoft Azure
        1. Create an Apache Spark Cluster in HDInsight Using the Azure Portal
        2. Install Libraries into a Cluster
        3. Copying RomeoAndJuliet.txt to the HDInsight Cluster
        4. Accessing Jupyter Notebooks in HDInsight
        5. Uploading the RomeoAndJulietCounter.ipynb Notebook
        6. Modifying the Notebook to Work with Azure
      5. Self Check for Section 17.6
    9. 17.7 Spark Streaming: Counting Twitter Hashtags Using the pyspark-notebook Docker Stack
      1. 17.7.1 Streaming Tweets to a Socket
        1. Executing the Script in the Docker Container
        2. starttweetstream.py import Statements
        3. Class TweetListener
        4. Main Application
      2. 17.7.2 Summarizing Tweet Hashtags; Introducing Spark SQL
        1. Importing the Libraries
        2. Utility Function to Get the SparkSession
        3. Utility Function to Display a Barchart Based on a Spark DataFrame
        4. Utility Function to Summarize the Top-20 Hashtags So Far
        5. Getting the SparkContext
        6. Getting the StreamingContext
        7. Setting Up a Checkpoint for Maintaining State
        8. Connecting to the Stream via a Socket
        9. Tokenizing the Lines of Hashtags
        10. Mapping the Hashtags to Tuples of Hashtag-Count Pairs
        11. Totaling the Hashtag Counts So Far
        12. Specifying the Method to Call for Every RDD
        13. Starting the Spark Stream
        14. Self Check for Section 17.7
    10. 17.8 Internet of Things and Dashboards
      1. 17.8.1 Publish and Subscribe
      2. 17.8.2 Visualizing a PubNub Sample Live Stream with a Freeboard Dashboard
        1. Signing up for Freeboard.io
        2. Creating a New Dashboard
        3. Adding a Data Source
        4. Adding a Pane for the Humidity Sensor
        5. Adding a Gauge to the Humidity Pane
        6. Adding a Sparkline to the Humidity Pane
        7. Completing the Dashboard
      3. 17.8.3 Simulating an Internet-Connected Thermostat in Python
        1. Installing Dweepy
        2. Invoking the simulator.py Script
        3. Sending Dweets
      4. 17.8.4 Creating the Dashboard with Freeboard.io
      5. 17.8.5 Creating a Python PubNub Subscriber
        1. Message Format
        2. Importing the Libraries
        3. List and DataFrame Used for Storing Company Names and Prices
        4. Class SensorSubscriberCallback
        5. Function Update
        6. Configuring the Figure
        7. Configuring the FuncAnimation and Displaying the Window
        8. Configuring the PubNub Client
        9. Subscribing to the Channel
        10. Ensuring the Figure Remains on the Screen
        11. Self Check for Section 17.8
    11. 17.9 Wrap-Up
    12. Exercises
      1. SQL and RDBMS Exercises
      2. NoSQL Database Exercises
      3. Hadoop Exercises
      4. Spark Exercises
      5. IoT and Pub/Sub Exercises
      6. Platform Exercises
      7. Other Exercises
  25. Index
3.146.105.194