1.

Record Nr.

UNINA9911030980203321

Autore

Russo Mark F

Titolo

Streamlining Your Research Laboratory with Python

Pubbl/distr/stampa

Newark : , : John Wiley & Sons, Incorporated, , 2025

©2025

ISBN

1-394-24990-X

Edizione

[1st ed.]

Descrizione fisica

1 online resource (382 pages)

Altri autori (Persone)

NeilWilliam

Disciplina

502.85/5133

Soggetti

Laboratories - Data processing

Python (Computer program language)

Lingua di pubblicazione

Inglese

Formato

Materiale a stampa

Livello bibliografico

Monografia

Nota di contenuto

Cover -- Half Title Page -- Title Page -- Copyright -- Contents -- Preface -- Chapter 1: Introduction -- 1.1 Python Implementations -- 1.2 Installing the Python Toolkit -- 1.3 Python 3 vs. Python 2 -- 1.4 Python Package Index -- 1.5 Programming Editors -- 1.6 Notebook Editors -- 1.7 Using the Jupyter Notebook Interface -- 1.8 JupyterLite -- 1.9 Things Change -- 1.10 Key Takeaways -- Chapter 2: Language Basics -- 2.1 Python Interactive Console -- 2.2 Data Types -- 2.3 Variables and Literals -- 2.4 Strings -- 2.4.1 Simple Strings -- 2.4.2 Multi-Line Strings -- 2.4.3 Escape Characters in a String -- 2.4.4 Raw Strings -- 2.4.5 Formatted Strings -- 2.4.6 Strings as Objects -- 2.4.7 Characters and Encodings -- 2.5 Expressions Using Operators -- 2.5.1 Arithmetic Operators -- 2.5.2 Assignment Operators -- 2.5.3 Comparison Operators -- 2.5.4 Boolean Operators -- 2.5.5 Chaining Comparisons -- 2.5.6 Comparing Floating-Point Numbers -- 2.6 Functions and How to Use Them -- 2.6.1 Invoking Functions -- 2.6.2 Built-in Functions -- 2.6.3 The math Module for Additional Mathematical Functions -- 2.6.4 The random Module for Pseudo-Random Number Generation -- 2.6.5 The time and datetime Modules for Handling Dates and Times -- 2.6.6 The sys Module for System Interactions -- 2.6.7 Scope and Namespace -- 2.7 Your First Python Program -- 2.8 Key Takeaways -- Chapter 3: Data Structures -- 3.1 Lists -- 3.1.1 Introducing Lists -- 3.1.2 Global Functions That Operate



on Lists -- 3.1.3 Accessing List Elements -- 3.1.4 Slicing Lists -- 3.1.5 Lists Operators -- 3.1.6 Lists as Objects -- 3.2 Tuples -- 3.2.1 Introducing Tuples -- 3.3 Dictionaries -- 3.3.1 Introducing Dictionaries -- 3.3.2 Global Functions That Operate on Dictionaries -- 3.3.3 Accessing Dictionary Items -- 3.3.4 Dictionary Operators -- 3.3.5 Dictionaries as Objects -- 3.4 Sets -- 3.4.1 Introducing Sets.

3.4.2 Global Functions That Operate on Sets -- 3.4.3 Accessing Set Elements -- 3.4.4 Set Operators -- 3.4.5 Sets as Objects -- 3.5 Destructuring Assignment -- 3.6 Key Takeaways -- Chapter 4: Controlling the Flow of a Program -- 4.1 Conditional Execution -- 4.1.1 If-Statements -- 4.1.2 If-Else Statements -- 4.1.3 If-Elif-Else Statements -- 4.1.4 If-Statement Strategies -- 4.1.5 Truthy and Falsy Values -- 4.1.6 Conditional Expressions -- 4.2 Repeated Execution -- 4.2.1 While-Statements -- 4.2.2 For-Statements -- 4.2.3 For-Statements with Range -- 4.2.4 Break and Continue -- 4.2.5 Comprehensions -- 4.3 Key Takeaways -- Chapter 5: Custom Functions and Exceptions -- 5.1 Defining Custom Functions -- 5.2 Arguments and Parameters -- 5.3 Names and Scope -- 5.3.1 Local vs. Global -- 5.3.2 Built-in and Nonlocal Scope -- 5.4 Scope vs. Namespace -- 5.5 Organizing Your Code with Modules -- 5.6 Decorators -- 5.7 How Things Go Wrong -- 5.8 Python Exceptions -- 5.9 Handling Exceptions -- 5.10 Raising Your Own Exceptions -- 5.11 Key Takeaways -- Chapter 6: Regular Expressions -- 6.1 Matching Literal Text -- 6.2 Alternation -- 6.3 Defining and Matching Character Classes -- 6.4 Metaclasses -- 6.5 Pattern Sequences -- 6.6 Repeating Patterns with Quantifiers -- 6.7 Anchors -- 6.8 Capturing Groups -- 6.9 Regular Expressions in Python -- 6.10 Project - A Formula Mass Calculator -- 6.11 Key Takeaways -- Chapter 7: Working with Data -- 7.1 A File System Primer -- 7.2 Text Files -- 7.3 Reading and Writing Text Files -- 7.4 Working with Comma-Separated Values (CSV) Files -- 7.5 The csv Module -- 7.6 Reading and Writing Excel Spreadsheet -- 7.6.1 openpyxl Workbook Object -- 7.6.2 openpyxl Worksheet Object -- 7.6.3 openpyxl Cell Object -- 7.7 Project - Generate a Random Sample Layout in a Spreadsheet -- 7.8 Project - Forecast Monthly Sample Processing.

7.9 Managing the File System -- 7.9.1 The Path Object -- 7.9.2 Path Properties -- 7.9.3 Path Attributes -- 7.9.4 Operating On a Path -- 7.9.5 Combining Paths -- 7.9.6 The shutil Module for High-Level File Operations -- 7.10 Walking a File System Tree -- 7.11 Project - Find Duplicate Files -- 7.12 Working with Zip Files -- 7.12.1 ZipFile Object -- 7.12.2 zipfile Path Object -- 7.12.3 Creating Zip Archives -- 7.13 Working with Standard Data Formats -- 7.13.1 JSON - JavaScript Object Notation -- 7.13.2 json Python Module -- 7.13.3 XML - Extensible Markup Language -- 7.13.4 Python XML modules -- 7.13.5 Other Standard Data Formats -- 7.14 Key Takeaways -- Chapter 8: Web Resources -- 8.1 TCP/IP Networks - What You Need to Know -- 8.1.1 Internet Protocol -- 8.1.2 Transmission Control Protocol -- 8.1.3 Connections and Ports -- 8.1.4 Application Layer Protocols -- 8.1.5 IPv4 vs. IPv6 Addresses -- 8.1.6 Proxy Servers -- 8.2 Introduction to Hypertext Transfer Protocol -- 8.2.1 The Uniform Resource Locator -- 8.2.2 Anatomy of an HTTP Request -- 8.2.3 Anatomy of an HTTP Response -- 8.3 Web Services and the Python Requests Module -- 8.3.1 HTTP GET Requests and the Response Object -- 8.3.2 HTTP POST Requests -- 8.3.3 Binary Responses -- 8.3.4 Customizing the Request Object -- 8.3.5 Verifying Certificates and Encryption -- 8.3.6 Other requests Module Options -- 8.4 Project - Print Weather Forecast for a Location -- 8.4.1 National Weather Service API Web Service -- 8.4.2 Getting Forecast URL from Geolocation -- 8.4.3 Loading and Processing



Forecast Data -- 8.4.4 Completed Program to Generate Temperature Forecast -- 8.5 Project - Scraping HTML Page Content -- 8.6 Key Takeaways -- Chapter 9: Data Analysis and Visualization -- 9.1 JupyterLab -- 9.2 Scientific Plotting with Matplotlib -- 9.2.1 The pyplot Submodule -- 9.2.2 The pyplot.plot() function.

9.2.3 Customizing a Plot -- 9.2.4 Multiple Curves on a Single Plot -- 9.2.5 Additional Plot Types -- 9.2.6 Multiple Axes on a Single Figure -- 9.2.7 Other Useful Functions -- 9.2.8 Project - Plotting Weather Forecast -- 9.2.9 Project - A Custom Microplate Heat Map -- 9.2.10 Other Scientific Plotting Libraries -- 9.3 NumPy - Numerical Python -- 9.3.1 Creating ndarray Objects -- 9.3.2 Working with ndarray Objects -- 9.3.3 Accessing and Updating ndarray Elements -- 9.3.4 Broadcasting -- 9.4 pandas DataFrame -- 9.4.1 Creating and Inspecting DataFrames -- 9.4.2 Filtering DataFrames -- 9.4.3 Project - A Screening Experiment -- 9.5 SciPy - A Library for Mathematics, Science, and Engineering -- 9.5.1 Descriptive Statistics with SciPy -- 9.5.2 Hypothesis Testing -- 9.5.3 Project - Running Hypothesis Tests on Two Samples -- 9.5.4 Project - Comparing Liquid Handler Syringe Performance -- 9.5.5 Linear Regression -- 9.5.6 Fitting Nonlinear Models to Data -- 9.5.7 Project - Four-Parameter Logistic Regression -- 9.6 Key Takeaways -- Chapter 10: Report Generation -- 10.1 BytesIO Object -- 10.2 Generating Reports in Microsoft Word -- 10.2.1 Document Object -- 10.2.2 Paragraph Object -- 10.2.3 Run Object -- 10.2.4 Picture and InlineShape Objects -- 10.2.5 Table Object -- 10.2.6 Project - Generate a Complete Word Report -- 10.3 Generating Microsoft PowerPoint Presentations -- 10.3.1 Presentation Object -- 10.3.2 Slide Objects -- 10.3.3 SlideShapes Object -- 10.3.4 Length Objects -- 10.3.5 Table Object -- 10.3.6 Project - Generate a PowerPoint Document with Figures and Tables -- 10.4 Generating PDF File Reports -- 10.4.1 ReportLab PDF Generation Process -- 10.4.2 Creating a Canvas Object -- 10.4.3 Setting Canvas Styles -- 10.4.4 Managing Text Blocks with PDFTextObjects -- 10.4.5 Canvas State Stack -- 10.4.6 Drawing Images -- 10.4.7 PLATYPUS for Page Layout.

10.4.8 Project - Generate a Complete PDF Report -- 10.5 Sending Email Programmatically -- 10.5.1 Simple Mail Transfer Protocol -- 10.5.2 SMTP Mail Server -- 10.5.3 Send a Simple Email Message -- 10.5.4 Sending Email Messages over a Secure Connection -- 10.5.5 Building an Email Message with Attachments -- 10.6 Serving Results with an HTTP Server -- 10.7 Key Takeaways -- Chapter 11: Control and Automation -- 11.1 Concurrency in Python -- 11.2 Asynchronous Execution -- 11.3 Concurrent Programs with AsyncIO -- 11.4 Asynchronous Instrument Control and Coordination -- 11.4.1 Project - Integrated Laboratory System Control and Coordination -- 11.5 Communicating over a Serial Port -- 11.5.1 Reading Barcodes from a Serial Port -- 11.5.2 Project - Scanning Sample Tasks into a Running Controller -- 11.6 Execute Remote Commands over HTTP -- 11.6.1 A Basic HTTP Server with aiohttp -- 11.6.2 Routing an HTTP Request to a Custom Python Function -- 11.7 Persistent Network Connections using a WebSocket -- 11.7.1 A User Interface for Asynchronous Networked Programs -- 11.7.2 WebSocketResponse and FileResponse Objects -- 11.7.3 Project - A Browser-Based WebSocket Message Broadcaster -- 11.7.4 Project - A Browser User Interface to Schedule Samples for Analysis -- 11.8 Responding to File System Changes -- 11.8.1 Watching a Directory for Changes with watchfiles -- 11.8.2 File System Monitoring Options -- 11.9 Executing Tasks on a Schedule -- 11.9.1 sched Module -- 11.9.2 Project - Taking and Sending Images on a Schedule -- 11.10 Key Takeaways -- Postface -- References -- Appendix A: ASCII American Standard Code for Information Interchange



-- Index -- EULA.

Sommario/riassunto

Enables scientists and researchers to efficiently use one of the most popular programming languages in their day-to-day work Streamlining Your Research Laboratory with Python covers the Python programming language and its ecosystem of tools applied to tasks encountered by laboratory scientists and technicians working in the life sciences. After opening with the basics of Python, the chapters move through working with and analyzing data, generating reports, and automating the lab environment. The book includes example processes within chapters and code listings on nearly every page along with schematics and plots that can clearly illustrate Python at work in the lab. The book also explores some real-world examples of Python's application in research settings, demonstrating its potential to streamline processes, improve productivity, and foster innovation. Streamlining Your Research Laboratory with Python includes information on: Language basics including the interactive console, data types, variables and literals, strings, and expressions using operators Custom functions and exceptions such as arguments and parameters, names and scope, and decorators Conditional and repeated execution as methods to control the flow of a program Tools such as JupyterLab, Matplotlib, NumPy, pandas DataFrame, and SciPy Report generation in Microsoft Word and PowerPoint, PDF report generation, and serving results through HTTP and email automatically Whether you are a biologist analyzing genetic data, a chemist scouting synthesis routes, an engineer optimizing machine parameters, or a social scientist studying human behavior, Streamlining Your Research Laboratory with Python serves as a logical and practical guide to add Python to your research toolkit.