Course Content
Introduction to Python for Data Analysis
Introduction to Python for Data Analysis
2. Introduction to Python 2/2
3. Explore Dataset
Data StudyOperations with the FileHow to Explore the DataSorting DataMax, min, mean, medianChallengeGroup DataDive Deeper into Grouping DataGroup Data 2.0Introduction to NumPyPivot TablesRecall Loops.loc FunctionDeal with Several ConditionsChallengeVisualization: First StepsDive Deeper into Visualization
Deal with Several Conditions
If you want to implement several conditions, you can do this easily.
- If you want to check dataset for the first and second condition to be True, just use
&
statement:
DataFrame.loc[condition1 & condition2]
- If you want to check dataset for the first or the second condition to be True, just use
|
statement:
DataFrame.loc[condition1 | condition2]
.
Everything was clear?
Thanks for your feedback!
Section 3. Chapter 14