Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

slice in iloc

df.iloc[:3] # slice your object, i.e. first three rows of your dataframe
df.iloc[0:3] # same
df.iloc[0, 1] # index both axis. Select the element from the first row, second column.
df.iloc[:, 0:5] # first five columns of data frame with all rows
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #slice #iloc
ADD COMMENT
Topic
Name
5+4 =