Last active
November 29, 2022 11:29
-
-
Save shanealynn/1efd0555a0a668b5f0e3f5fa5593c673 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Single selections using iloc and DataFrame | |
# Rows: | |
data.iloc[0] # first row of data frame (Aleshia Tomkiewicz) - Note a Series data type output. | |
data.iloc[1] # second row of data frame (Evan Zigomalas) | |
data.iloc[-1] # last row of data frame (Mi Richan) | |
# Columns: | |
data.iloc[:,0] # first column of data frame (first_name) | |
data.iloc[:,1] # second column of data frame (last_name) | |
data.iloc[:,-1] # last column of data frame (id) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment