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
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Suggested prompts:
Ask me questions about this topic
Summarize this chapter
Show real-world examples
Awesome!
Completion rate improved to 2.08
Deal with Several Conditions
Swipe to show menu
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