In Pandas, data is typically arranged in rows and columns. A DataFrame is an indexed and typed two-dimensional data structure. In Pandas, you can use a technique called DataFrame slicing to extract just the data you need from large or small datasets.
In this guide, we’ll use Numpy to create a dataset for us, and then use Pandas to slice a DataFrame.
Creating a Dataset with NumPy
Before we can slice a DataFrame, we first need to create a two-dimensional array of data. A two-dimensional array is a vertical and horizontal representation, such as a table with rows and columns. We`ll use another popular Python library called NumPy and its arrange() and reshape() functions to create our table.

#python3 #iloc #loc #pandas #pandas-dataframe

How to Slice A DataFrame in Pandas
1.50 GEEK