Skip to Content
Streamlining Your Research Laboratory with Python
book

Streamlining Your Research Laboratory with Python

by Mark F. Russo, William Neil
July 2025
Intermediate to advanced
384 pages
11h 53m
English
Wiley
Content preview from Streamlining Your Research Laboratory with Python

Chapter 7Working with Data

The core function of any research laboratory is to run experiments and collect data. In this chapter, we take a deep dive into some of the most important tools available in Python for working with data.

7.1 A File System Primer

Before we get started, let’s review the file system. Recall that a file can be thought of as a stored sequence of bytes. A computer’s file system provides a way to store and organize files permanently on disk. The computer’s operating system includes software that is used to access and modify these files and their content.

Files in a file system are organized as a hierarchy with a single root directory or folder at the top. The terms folder and directory are used interchangeably. We’ll try to stick with the term directory because Python uses that term in several of its commands. A directory can contain files and additional nested subdirectories, forming a multi-level data structure. Each file and directory in a file system is identified uniquely using a path starting at the file system root. A path is the location of the file or directory as found by navigating the file system from the root directory.

For example, let’s assume we have the file hierarchy of Figure 7.1. The root directory of the file system is named "/" and it contains one subdirectory named Documents. The Documents directory contains the Instruments directory, which itself contains the two subdirectories Data and Backup. The Data directory contains the file ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Python Tools for Scientists

Python Tools for Scientists

Lee Vaughan
Algorithmic Management: The Role of AI in Managing Workforces

Algorithmic Management: The Role of AI in Managing Workforces

Mohammad Hossein Jarrahi, Mareike Möhlmann, Min Kyung Lee

Publisher Resources

ISBN: 9781394249886