Learning Objectives#

Introducing Python#

Although we are big fans of AI coding assistants, we also believe that it is important to understand the fundamentals of programming. You cannot trust or debug AI-generated code if you don’t know how to write code that does what you want. In this chapter, we will introduce the basic concepts of programming in Python. We will start with the basics of Python syntax, and then move on to more advanced topics like data types, flow control, and reading and writing data files. We will introduce AI assitance at the start of the next chapter.

By the end of this chapter, you should be able to:

  • understand and use variables

  • work with common Python data types like integers, floats, strings, characters, lists, dictionaries, as well as pandas DataFrames

  • use basic flow control, including for loops and conditionals

  • read data from text files

  • obtain basic summary statistics from data files

  • manipulate and extract data from pandas DataFrames

  • write Python code according to standard style guidelines