Selecting Subsets of Data in Pandas: Part 3
Part 3: Assigning subsets of data
This is part three of a four-part series on how to select subsets of data from a pandas DataFrame or Series. Pandas offers a wide variety of options for subset selection which necessitates multiple articles. This series is broken down into the following topics.
- Selection with
[]
,.loc
and.iloc
- Boolean indexing
- Assigning subsets of data
- How NOT to select subsets of data
Become an Expert
If you want to be trusted to make decisions using pandas, you must become an expert. I have completely mastered pandas and have developed courses and exercises that will massively improve your knowledge and efficiency to do data analysis.
- Master Data Analysis with Python — My comprehensive course with 800+ pages, 500+ exercises, multiple projects, detailed solutions, and video lessons that will help you become an expert at pandas.
- Get a sample of the material by enrolling in the free Intro to Pandas course.
Assignment
When you see the word assign used during a discussion on programming, it usually means that a variable is set equal to some value. For most programming languages, this means using the equal sign. For instance, to assign the value 5 to the variable x
in Python, we do the following: