You are previewing Foundations for Analytics with Python.
O'Reilly logo
Foundations for Analytics with Python

Book Description

If you’re like many of Excel’s 750 million users, you want to do more with your data—like repeating similar analyses over hundreds of files, or combining data in many files for analysis at one time. This practical guide shows ambitious non-programmers how to automate and scale the processing and analysis of data in different formats—by using Python. After author Clinton Brownley takes you through Python basics, you’ll be able to write simple scripts for processing data in spreadsheets as well as databases.

Table of Contents

  1. Preface
    1. How to Read This Book
    2. Conventions Used in This Book
    3. About Early Release books from O’Reilly
    4. Using Code Examples
    5. Safari® Books Online
    6. How to Contact Us
  2. 1.
    1. Why Read This Book? Why Learn These Skills?
    2. Who Is This Book For?
    3. Why Windows
    4. Why Python
    5. Base Python and Pandas
    6. Anaconda Python
      1. To install Anaconda Python (Windows or Mac)
    7. Text Editors
    8. Download Book Materials
    9. Base Python and Pandas
    10. Overview of Chapters
  3. 2. Python Basics
    1. Running Python in the Shell
    2. How To Create a Python Script
    3. How to Run a Python Script
    4. A few more hints for interacting with the command line
      1. Up Arrow for Previous Command
      2. Ctrl+c to Stop a Script
      3. Read and Search for Solutions to Error Messages
      4. Add More Code to
    5. Python’s Basic Building Blocks
    6. Numbers
      1. Integers
      2. Floating-point numbers
    7. Strings
      1. Split
      2. Join
      3. Strip
      4. Replace
      5. Lower, Upper, Capitalize
    8. Regular Expressions and Pattern Matching
    9. Dates
    10. Lists
      1. Create a list
      2. Index values
      3. List slices
      4. Copy a list
      5. IN and NOT IN
      6. Append, Remove, Pop
      7. Reverse
      8. Sorting
    11. Tuples
      1. Create a tuple
      2. >Unpack tuples
      3. Convert tuple to list, list to tuple
    12. Dictionaries
      1. Create a dictionary
      2. Keys
      3. Copy
      4. IN, NOT IN, and GET
      5. Sort
    13. Control Flow
      1. If-Else
      2. If-Elif-Else
      3. For Loops
      4. Compact For Loops: List, Set, and Dictionary Comprehensions
      5. While Loops
      6. Functions
      7. Exceptions
      8. Try-Except
      9. Try-Except-Else-Finally
      10. Reading a Text File
        1. Create a text file
        2. Script and Input File in Same Location
        3. Modern File Reading Syntax
        4. Reading Multiple Text Files with Glob
          1. Create another text file
        5. Writing to a Text File
        6. Writing to a Comma Separated Values “CSV” File
      11. Print Statements
      12. Chapter Exercises: