Home
Explore
Exams
Search for anything
Login
Get started
Home
Indexing and Selecting Data with Pandas
Indexing and Selecting Data with Pandas
0.0
(0)
Rate it
Studied by 0 people
0.0
(0)
Rate it
Call Kai
Learn
Practice Test
Spaced Repetition
Match
Flashcards
Knowt Play
Card Sorting
1/21
There's no tags or description
Looks like no tags are added yet.
Study Analytics
All Modes
Learn
Practice Test
Matching
Spaced Repetition
Name
Mastery
Learn
Test
Matching
Spaced
No study sessions yet.
22 Terms
View all (22)
Star these 22
1
New cards
Selecting a Single Column
first = data["Age"]
2
New cards
Selecting Multiple Columns
first = data[["Age", "College", "Salary"]]
3
New cards
Selecting a Single Row by Label
row = data.loc["Avery Bradley"]
4
New cards
Selecting Multiple Rows
rows = data.loc[["Avery Bradley", "R.J. Hunter"]]
5
New cards
Selecting Specific Rows and Columns
selection = data.loc[["Avery Bradley", "R.J. Hunter"], ["Team", "]Number", "Position"]
6
New cards
Selecting All Rows and Specific Columns
all_rows_specific_columns = data.loc[:, ["Team", "Position", "Salary"]]
7
New cards
Selecting a Single Row by Position
row = data.iloc[3]
8
New cards
Selecting Multiple Rows by Position
rows = data.iloc[[3, 5, 7]]
9
New cards
Selecting Specific Rows and Columns by Position
selection = data.iloc[[3, 4], [1, 2]]
10
New cards
Selecting All Rows and Specific Columns by Position
selection = data.iloc[:, [1, 2]]
11
New cards
.head(): Returns the first n rows of a DataFrame
print(data.head(5))
12
New cards
.tail(): Returns the last n rows of a DataFrame
print(data.tail(5))
13
New cards
.at[]: Access a single value for a row/column label pair
value = data.at["Avery Bradley", "Age"]
14
New cards
.query(): Query the DataFrame using a boolean expression
result = data.query("Age > 25 and College == 'Duke'")
15
New cards
DataFrame.iat[]
Access a single value for a row/column pair by integer position.
16
New cards
DataFrame.pop()
Return item and drop from DataFrame.
17
New cards
DataFrame.xs()
Return a cross-section (row(s) or column(s)) from the DataFrame.
18
New cards
DataFrame.get()
Get item from object for given key (e.g DataFrame column).
19
New cards
DataFrame.isin()
Return a boolean DataFrame showing whether each element is contained in values.
20
New cards
DataFrame.where()
Return an object of the same shape with entries from self where cond is True otherwise from other.
21
New cards
DataFrame.mask()
Return an object of the same shape with entries from self where cond is False otherwise from other.
22
New cards
DataFrame.insert()
Insert a column into DataFrame at a specified location.
Explore top notes
AP Psychology - Motivation, Emotion, & Personality
Updated 1123d ago
Note
Preview
Carbonyl full summary
Updated 183d ago
Note
Preview
2.6 The Middle Ages
Updated 1056d ago
Note
Preview
2.1: Classification and biodiversity
Updated 898d ago
Note
Preview
Top 200 Drug
Updated 1130d ago
Note
Preview
Useful acronyms for Computer Science
Updated 1095d ago
Note
Preview
Invisible Man Chapter 22
Updated 1006d ago
Note
Preview
Biostatistics, Chapters I & II
Updated 1116d ago
Note
Preview
AP Psychology - Motivation, Emotion, & Personality
Updated 1123d ago
Note
Preview
Carbonyl full summary
Updated 183d ago
Note
Preview
2.6 The Middle Ages
Updated 1056d ago
Note
Preview
2.1: Classification and biodiversity
Updated 898d ago
Note
Preview
Top 200 Drug
Updated 1130d ago
Note
Preview
Useful acronyms for Computer Science
Updated 1095d ago
Note
Preview
Invisible Man Chapter 22
Updated 1006d ago
Note
Preview
Biostatistics, Chapters I & II
Updated 1116d ago
Note
Preview
Explore top flashcards
Social Studies M2
Updated 344d ago
Flashcards (27)
Preview
Unit 8 AP World History
Updated 548d ago
Flashcards (51)
Preview
Vocabulary
Updated 391d ago
Flashcards (34)
Preview
New Insights 7 text 9
Updated 62d ago
Flashcards (78)
Preview
classification quiz: viruses and germ theory 4/17 🦢🎧🧦
Updated 923d ago
Flashcards (27)
Preview
La Niñez
Updated 946d ago
Flashcards (68)
Preview
Digestive GI Tract Anatomy & Physiology
Updated 752d ago
Flashcards (63)
Preview
APLAC Rhetorical Vocabulary (1-120)
Updated 43m ago
Flashcards (120)
Preview
Social Studies M2
Updated 344d ago
Flashcards (27)
Preview
Unit 8 AP World History
Updated 548d ago
Flashcards (51)
Preview
Vocabulary
Updated 391d ago
Flashcards (34)
Preview
New Insights 7 text 9
Updated 62d ago
Flashcards (78)
Preview
classification quiz: viruses and germ theory 4/17 🦢🎧🧦
Updated 923d ago
Flashcards (27)
Preview
La Niñez
Updated 946d ago
Flashcards (68)
Preview
Digestive GI Tract Anatomy & Physiology
Updated 752d ago
Flashcards (63)
Preview
APLAC Rhetorical Vocabulary (1-120)
Updated 43m ago
Flashcards (120)
Preview