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
# Multiple row and column selections using iloc and DataFrame | |
data.iloc[0:5] # first five rows of dataframe | |
data.iloc[:, 0:2] # first two columns of data frame with all rows | |
data.iloc[[0,3,6,24], [0,5,6]] # 1st, 4th, 7th, 25th row + 1st 6th 7th columns. | |
data.iloc[0:5, 5:8] # first 5 rows and 5th, 6th, 7th columns of data frame (county -> phone1). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How if like this.
Data.iloc[x,:7]
I want to make x (row) in range 0:5 and 6:7