Index
Symbols
- != (not equal to), if-else
- " (double quotes), Strings
- # (hash character), How to Create a Python Script
- #! (shebang character), How to Create a Python Script
- & (ampersands), Pandas
- ' (single quotes), Strings
- * (wildcard character), Count Number of Files and Number of Rows and Columns in Each File
- * operator, Strings
- + (concatenation operator), Strings, Copy a list
- . (period), Base Python
- .* notation, Base Python
- / (backslash character), Strings
- == (equality operator), if-elif-else
- >>> (Python prompt), Python Basics
- [ ] (square brackets), Access a value in a dictionary, Compact for loops: list, set, and dictionary comprehensions
- \t (tab characters), Count Number of Files and Number of Rows and Columns in Each File
- { } (curly braces), Compact for loops: list, set, and dictionary comprehensions
- | (pipes), Pandas
A
- acknowledgments, Acknowledgments
- ampersands (&), Pandas
- Anaconda Python, Anaconda Python
- append method, append, remove, pop
- append mode ('a') , Writing to a Comma-Separated Values (CSV) File
- arguments, split
- argv list variable, Reading a Text File
- associative arrays, Dictionaries
- attributions, Using Code Examples
- averages, calculating, Sum and Average a Set of Values per File, Base Python
C
- capitalize function, lower, upper, capitalize
- cartopy, matplotlib
- characters
- code
- coefficients, interpreting, Interpreting Coefficients, Interpreting Coefficients
- collections module, Python Standard Library (PSL): A Few More Standard Modules
- columns
- in CSV files
- in Excel files
- command line
- commas, embedded, How Basic String Parsing Can Fail, Base Python, with csv module
- comments, How to Contact Us
- commit() method, Python’s Built-in sqlite3 Module
- compact for loops, Compact for loops: list, set, and dictionary comprehensions
- compile function, Base Python, Base Python
- concat function, Pandas, Pandas
- concatenation operator (+), Strings, Copy a list
- contact information, How to Contact Us
- control flow elements
- compact for loops, Compact for loops: list, set, and dictionary comprehensions
- exceptions, Exceptions
- for loops, if-elif-else-Dictionary comprehension
- functions, Functions
- if-elif-else, if-else
- if-else, Control Flow
- overview of, Control Flow
- text files
- try-except, Exceptions
- try-except-else-finally, try-except
- while loops, Dictionary comprehension
- copy function, copy
- copying
- count function, Create a list
- cron utility
- CRUD (Create, Read, Update, and Delete) , Python’s Built-in sqlite3 Module
- CSV (comma-separated values) files
- benefits of, Comma-Separated Values (CSV) Files
- calculating statistics from, Calculate a Statistic for Any Number of Categories from Data in a CSV File-Calculate a Statistic for Any Number of Categories from Data in a CSV File
- columns in
- concatenating, Concatenate Data from Multiple Files-Pandas
- counting number of, Count Number of Files and Number of Rows and Columns in Each File-Count Number of Files and Number of Rows and Columns in Each File
- creating, Comma-Separated Values (CSV) Files
- creating multiple, Reading Multiple CSV Files
- vs. Excel files, Comma-Separated Values (CSV) Files, Introspecting an Excel Workbook
- inserting data into tables, Insert New Records into a Table-Insert New Records into a Table
- reading multiple, Reading Multiple CSV Files-Pandas
- reading/writing in base Python, Base Python, without csv module-Base Python, without csv module
- reading/writing with csv module, Base Python, with csv module
- reading/writing with NumPy, Reading and writing CSV and Excel files
- rows in
- string parsing failures, How Basic String Parsing Can Fail
- updating data in tables, Update Records in a Table-Update Records in a Table
- writing output to, Query a Table and Write Output to a CSV File
- writing to, Writing to a Comma-Separated Values (CSV) File
- csv module, Base Python, with csv module, Insert New Records into a Table, Insert New Records into a Table
- curly braces ({ }), Compact for loops: list, set, and dictionary comprehensions
- cursor objects, Python’s Built-in sqlite3 Module
- Customer Churn dataset, Customer Churn, Customer Churn-Making Predictions
D
- data analysis
- additional modules/functions for, Additional Standard Library Modules and Built-in Functions-Trees
- aggregating/searching historical files, Find a Set of Items in a Large Collection of Files
- approaching a project, Where to Go from Here
- basic programming skills for, Base Python and pandas
- benefits of Python for, Why Read This Book? Why Learn These Skills?, Why Python?
- CSV files, Comma-Separated Values (CSV) Files-Pandas
- databases, Databases-Update Records in a Table
- descriptive statistics and modeling, Descriptive Statistics and Modeling-Making Predictions
- dirty data, Pandas
- Excel files, Excel Files-Pandas
- figures and plots, Figures and Plots-seaborn
- operating systems covered, Why Windows?
- overview of tasks and tools, Where to Go from Here, Where to Go from Here
- prerequisites to learning, Who Is This Book For?
- scheduling scripts, Scheduling Scripts to Run Automatically-Adding Cron Jobs to the Crontab File
- data structures
- data visualizations
- databases
- DataFrames, Pandas, Pandas, Pandas, Pandas, Pandas
- dates and times, Dates-Dates, Format dates
- datetime module, Dates-Dates, Format dates, Insert New Records into a Table
- def keyword, Functions
- descriptive statistics and modeling
- Customer Churn dataset
- Scikit-Learn module, Scikit-Learn
- stats package (SciPy), Descriptive statistics
- Wine Quality dataset
- correlations, Pairwise Relationships and Correlation
- dataset preparation, Wine Quality
- grouping data, Grouping, Histograms, and t-tests
- histogram creation, Grouping, Histograms, and t-tests
- interpreting coefficients, Interpreting Coefficients
- least-squares regression, Linear Regression with Least-Squares Estimation
- linear regressions, Linear Regression with Least-Squares Estimation
- making predictions , Making Predictions
- pairwise relationships, Pairwise Relationships and Correlation
- standardizing independent variables, Standardizing Independent Variables
- statistics, Descriptive Statistics
- t-tests, Grouping, Histograms, and t-tests
- dictionaries
- accessing keys and values in, copy
- accessing specific values in, Create a dictionary
- common business uses for, Dictionaries
- copying, Access a value in a dictionary
- creating, Dictionaries
- dictionary comprehensions, Compact for loops: list, set, and dictionary comprehensions
- vs. lists, Dictionaries
- sorting, Using in, not in, and get
- testing for specific keys, keys, values, and items
- dirty data, Pandas
- double equal sign (==), if-elif-else
- double quotes ("), Strings
- drop function, Pandas
E
- enumerate() function, Built-in Functions
- equality operator (==), if-elif-else
- error messages
- ETL (extract, transform, load), Why Read This Book? Why Learn These Skills?
- Excel files
- converting to NumPy arrays, Excel files
- vs. CSV files, Comma-Separated Values (CSV) Files, Introspecting an Excel Workbook
- date/time formatting in, Format dates
- determining worksheet names, Introspecting an Excel Workbook
- filtering for specific rows, Filter for Specific Rows-Pandas
- matching patterns, Base Python
- processing multiple workbooks, Processing Multiple Workbooks-Pandas
- reading a set of worksheets, Reading a Set of Worksheets in an Excel Workbook-Pandas
- reading all worksheets in a workbook, Reading All Worksheets in a Workbook-Pandas
- reading/writing, Base Python with xlrd and xlwt modules-Pandas
- selecting specific columns, Select Specific Columns-Pandas
- workbook creation, Excel Files, Processing Multiple Workbooks
- workbook introspection, Introspecting an Excel Workbook-Introspecting an Excel Workbook
- exceptions
- execute() method, Python’s Built-in sqlite3 Module
- executemany() method, Python’s Built-in sqlite3 Module
- exp function, Floating-point numbers
- exploratory data analysis (EDA), Figures and Plots
F
- fetchall() method, Python’s Built-in sqlite3 Module
- figures and plots (see data visualization)
- filter() function, Built-in Functions
- first_script.py, adding code to, Useful Tips for Interacting with the Command Line, Add Code to first_script.py
- floating-point numbers, Floating-point numbers, MySQL Database
- for loops, if-elif-else-Dictionary comprehension
- .format, Useful Tips for Interacting with the Command Line
- frequency distributions, Histogram
- functions
I
- if statements, Using in and not in, Using in, not in, and get
- if-elif-else statements, if-else
- if-else statements, Control Flow
- import statement, Python Standard Library (PSL): A Few More Standard Modules
- in expression, Using in and not in, Using in, not in, and get
- indentation, Why Python?, Using in, not in, and get
- independent variables, standardizing, Standardizing Independent Variables
- index values, Index values, Base Python
- INSERT statement, Python’s Built-in sqlite3 Module
- int function, Integers
- integers, Numbers
- interpolate package (SciPy), interpolate
- isin function, Pandas
- itemgetter function, sort
- items function, keys, values, and items, for loops
- itertools module, Python Standard Library (PSL): A Few More Standard Modules
- ix function, Pandas, Pandas-Reading a Set of Worksheets in an Excel Workbook
L
- lambda functions, sort
- least-squares regression, Linear Regression with Least-Squares Estimation, Least-squares regression
- len function, Strings, Create a list, for loops, Writing to a Text File
- linalg package (SciPy), linalg
- line plots, Line Plot
- linear correlations, Pairwise Relationships and Correlation
- linear regressions, Linear Regression with Least-Squares Estimation, Linear regression
- linear systems of equations, Linear systems of equations
- list comprehensions, List comprehension
- lists
- accessing specific values in, Create a list
- accessing subsets of elements in, Index values
- adding/removing elements, Using in and not in
- checking for specific elements in, Copy a list
- converting to tuples, Convert tuples to lists (and vice versa)
- copying, List slices
- creating, Lists
- vs. dictionaries, Dictionaries
- joining, Copy a list
- reversing in-place, append, remove, pop
- sorting in-place, reverse
- log function, Floating-point numbers
- logistic regressions, Logistic Regression
- lower function, lower, upper, capitalize
- lstrip function, strip
M
- math module, Floating-point numbers
- mathematical operations, Floating-point numbers
- matplotlib
- max function, Create a list
- merge function, Pandas
- metacharacters, Regular Expressions and Pattern Matching
- Microsoft Excel (see Excel files)
- Microsoft Windows, Why Windows?
- min function, Create a list
- modeling (see descriptive statistics and modeling)
- mplot3d, matplotlib
- MySQL, Calculate Statistics for Any Number of Categories from Data in a Text File
- MySQL-python, Why Python?, MySQL Database, Download mysqlclient (Python 3.x)/MySQL-python (Python 2.x)
- mysqlclient, Why Python?, MySQL Database, Download mysqlclient (Python 3.x)/MySQL-python (Python 2.x)
- MySQLdb package, Why Python?, MySQL Database, Windows-Option 2
N
- non-relational databases, Databases
- not equal to (!=), if-else
- not in expression, Using in and not in
- numbers
- NumPy module
- benefits of, NumPy
- concatenating data with, Pandas, Concatenate data
- converting data to arrays, Convert to a NumPy array
- determining data types, genfromtxt
- filtering for specific rows, Filter rows
- loading data, loadtxt
- reading/writing CSV and Excel files, Reading and writing CSV and Excel files
- saving data to text files, savetxt
- selecting specific columns, Select specific columns
P
- pairwise bivariate visualizations, seaborn
- pairwise univariate visualizations, Pairwise Relationships and Correlation
- Pandas
- benefits of, Base Python and pandas, Base Python Versus pandas
- CSV files
- adding column headers, Pandas
- column heading selection, Pandas
- column index value selection, Pandas
- column sum/average calculations, Pandas
- concatenating, Pandas
- reading/writing, Pandas
- selecting contiguous rows, Pandas
- value in row in set of interest, Pandas
- value in row matches pattern, Pandas
- value in row meets condition, Pandas
- Excel files
- column heading selection, Pandas
- column index value selection, Pandas
- concatenating data from multiple workbooks, Pandas
- filtering rows across all worksheets, Pandas
- filtering rows across worksheet sets, Pandas
- reading/writing, Pandas
- selecting columns across all worksheets, Pandas
- sum/average calculations, Pandas
- value in row in set of interest, Pandas
- value in row matches pattern, Pandas
- value in row meets condition, Pandas
- functionality of, Why Python?
- recommended reference books, Base Python and pandas, Base Python Versus pandas
- pandas
- parsing, failures of, How Basic String Parsing Can Fail
- passwd argument, Insert New Records into a Table
- pathnames, Count Number of Files and Number of Rows and Columns in Each File
- pattern matching, Regular Expressions and Pattern Matching-Regular Expressions and Pattern Matching, Base Python, Base Python
- period (.), Base Python
- permission, obtaining, Using Code Examples
- pipes (|), Pandas
- plots and figures (see data visualizations)
- pop method, append, remove, pop
- predications, making, Making Predictions, Making Predictions
- print statements, How to Create a Python Script, print Statements
- prompt (>>>), Python Basics
- Python
- additional add-in modules, Python Package Index (PyPI): Additional Add-in Modules-A Few Additional Add-in Packages
- additional data structures, Additional Data Structures-Trees
- additional standard modules, Additional Standard Library Modules and Built-in Functions
- Anaconda Python installation, Anaconda Python
- benefits of, Why Read This Book? Why Learn These Skills?, Why Python?
- built-in functions, Built-in Functions
- command line interactions, Useful Tips for Interacting with the Command Line-Useful Tips for Interacting with the Command Line
- control flow elements, Control Flow-
- CSV files
- column header addition, Base Python
- column heading selection, Base Python
- column index value selection, Base Python
- column sum/average calculations, Base Python
- concatenating, Base Python
- reading/writing in base, Base Python, without csv module-Base Python, without csv module
- reading/writing with csv module, Base Python, with csv module
- selecting contiguous rows in, Base Python
- value in row in set of interest, Base Python
- value in row matches pattern, Base Python
- value in row meets condition, Base Python
- dates, Dates-Dates
- dictionaries, Dictionaries-Sorting
- distributions available, Anaconda Python
- error messages, Useful Tips for Interacting with the Command Line
- Excel files
- column heading selection, Base Python
- column index value selection, Base Python
- concatenating data from multiple workbooks, Base Python
- filtering rows across all worksheets, Base Python
- filtering rows across worksheet sets, Base Python
- selecting columns across all worksheets, Base Python
- sum/average values calculation, Base Python
- value in row in set of interest, Base Python
- value in row matches pattern, Base Python
- value in row meets condition, Base Python-Base Python
- installing on Mac OS X, macOS
- installing on Windows, Windows
- lists, Lists-sort
- numbers, Numbers-Floating-point numbers
- vs. other languages, Why Python?
- pattern matching, Regular Expressions and Pattern Matching-Regular Expressions and Pattern Matching
- print statements, print Statements
- script creation, How to Create a Python Script
- script execution, How to Run a Python Script-How to Run a Python Script
- script interruption, Useful Tips for Interacting with the Command Line
- shell execution, Python Basics
- strings, Strings-lower, upper, capitalize
- text files
- tuples, Tuples-Convert tuples to lists (and vice versa)
- Python Package Index (PyPI)
- Python Standard Library (PSL)
R
- random module, Python Standard Library (PSL): A Few More Standard Modules
- range function, for loops, Writing to a Text File
- re module, Regular Expressions and Pattern Matching-Regular Expressions and Pattern Matching, Base Python
- readline method, Base Python, without csv module
- read_csv function, Pandas
- read_excel function, Pandas, Pandas, Pandas
- regression models, seaborn
- regular expressions, Regular Expressions and Pattern Matching-Regular Expressions and Pattern Matching, Base Python, Pandas
- reindex function, Pandas
- relational database management systems (RDBMSs), Databases
- remove method, append, remove, pop
- replace function, replace
- return keyword, Functions
- reverse function, reverse
- rows
- rstrip function, strip
S
- scatter plots, Scatter Plot, seaborn
- Scikit-Learn module, Why Python?, Scikit-Learn
- SciPy module, SciPy-Linear regression
- scripts
- adding code to first_script.py, Useful Tips for Interacting with the Command Line, Add Code to first_script.py
- creating, How to Create a Python Script
- downloading, Download Book Materials
- executing, How to Run a Python Script-How to Run a Python Script
- failure of string parsing, How Basic String Parsing Can Fail
- operating systems covered, Why Windows?
- reading text files, Reading a Text File
- scheduling benefits, Scheduling Scripts to Run Automatically, Task Scheduler (Windows)
- scheduling methods, Scheduling Scripts to Run Automatically
- scheduling on Mac OS X and Unix, The cron Utility (macOS and Unix)-Adding Cron Jobs to the Crontab File
- scheduling on Windows, Task Scheduler (Windows)-Task Scheduler (Windows)
- stopping, Useful Tips for Interacting with the Command Line
- seaborn, seaborn-seaborn
- set comprehensions, Set comprehension
- shebang character (#!), How to Create a Python Script
- sheet_by_index function, Base Python
- single quotes ('), Strings
- slices, List slices
- sort function, sort
- sorted function, sort
- spaces
- split function, split
- spreadsheets, vs. databases, Databases
- Spyder, Anaconda Python
- SQL (Structured Query Language), Databases
- SQL injection attacks, Python’s Built-in sqlite3 Module
- sqlite3 module, Databases-Python’s Built-in sqlite3 Module
- sqrt (square root) function, Floating-point numbers
- square brackets ([ ]), Access a value in a dictionary, Compact for loops: list, set, and dictionary comprehensions
- stacks, Stacks
- statistical graphs
- bar plots, Bar Plot
- box plots, Box Plot, seaborn
- histograms, Histogram, seaborn
- line plots, Line Plot
- pairwise bivariate visualizations, seaborn
- regression models, seaborn
- scatter plots, Scatter Plot, seaborn
- statistics
- statistics module, Python Standard Library (PSL): A Few More Standard Modules
- stats package (SciPy), stats
- statsmodels
- str function, for loops
- string module, Insert New Records into a Table
- strings
- basics of, Strings
- built-in operators for, Strings
- changing character capitalization, lower, upper, capitalize
- combining substrings, join
- multi-line, Strings
- parsing failures, How Basic String Parsing Can Fail
- quote marks delimiting, Strings
- removing unwanted characters from, strip
- replacing characters, replace
- splitting into substrings, split
- string module, Strings
- strip function, strip
- sums, calculating, Sum and Average a Set of Values per File, Base Python
- sys module, Reading a Text File, Insert New Records into a Table, Insert New Records into a Table
T
- t-tests, Grouping, Histograms, and t-tests, Grouping, Histograms, and t-tests
- tab characters (\t), Count Number of Files and Number of Rows and Columns in Each File
- tables (see also databases)
- tabs, removing, strip
- Task Scheduler
- text editors, Text Editors
- text files
- times and dates, Dates-Dates
- trees, Trees
- try-except blocks, Exceptions
- try-except-else-finally blocks, try-except
- tuples, Tuples-Convert tuples to lists (and vice versa)
- type function, Floating-point numbers
- typographical conventions, Conventions Used in This Book
W
- while loops, Dictionary comprehension
- whitespace
- wildcard character (*), Count Number of Files and Number of Rows and Columns in Each File
- Windows, Why Windows?
- Wine Quality dataset, Wine Quality-Making Predictions
- with statement,
- workbook.datemode argument, Format dates
- workbooks/worksheets (see Excel files)
- write method, Writing to a Text File, Base Python, without csv module
- write mode ('w'), Add Code to first_script.py, Writing to a Comma-Separated Values (CSV) File
- writelines method, Writing to a Text File