# Remember to always use double square bracket `[[]]` for specifying columns to get dataframe
# Slicing only columns
df[['col1','col2']]
# Slicing only rows
df[1:6]
# Slicing both rows and columns with loc (use string)
df.loc[['index_name1', 'index_name2'], ['col1', 'col2']]
# Slicing both rows and columns with iloc (use integer)
df.iloc[[row_nums], [col_nums]] # df.iloc[1:3, 0:2]
# Multi-level index slicing
# NOTE : Make sure to sort the index first before slicing with .loc
df.loc[('col1val1','col2val1') : ('col1val2','col2val2') ])
# Slicing with date index
df.loc['2010-08-01' : '2011-02-28',:]`