Conventions used
There are a number of text conventions used throughout this book.
Code in text
: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: “Click on the cell to activate it, type print(“Hello, world!”), and then click the play button to run the code.”
A block of code is set as follows:
# Calculate median (middle value) median_sales = sales_data_year1.median() print(f"The median monthly sales, a typical sales month, is {round(median_sales)} units.")
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
# Calculate standard deviation (measure of the amount of variation) std_dev_sales = sales_data_year1.std() print(f"The standard deviation, showing the typical variation from the mean sales, is {round(std_dev_sales)} units.")
Bold: Indicates a new term, an important word, or words that you see onscreen. For instance, words in menus or dialog boxes appear in bold. Here is an example: “Click File, then choose New Notebook from the dropdown.”
Tips or important notes
Appear like this.