Member-only story

Pandas Tutorial: Pandas Dataframe Basics

Jesse L
3 min readOct 11, 2021

--

Hi everyone, welcome back. Pandas is a library for the Python programming language and is commonly used for data science purposes. Pandas can refer to both “Panel Data” and “Python Data Analysis”. Pandas is used specifically for working with data sets and provides various functions and support regarding data. In order to use Pandas on your machine, you will need Python and Pandas installed and ready to go. Getting started with Pandas can be found here.

Pandas makes many data-related tasks easy for developers and data scientists. Pandas makes this possible by using dataframes and manipulating them. The structure of Pandas dataframes are similar to that of a 2D array or a table.

Creating DataFrames

Let’s see an example of how to create a dataframe:

import pandas as pd
data = {
'drinks': ["coke", "juice", "water"],
'food': ["soup", "salad", "sandwich"]
}
myDataFrame = pd.DataFrame(data)
print(myDataFrame)
Output: drinks food
0 coke soup
1 juice salad
2 water sandwich

As you can see in our output, we have displayed our data frame. Our output provides us with our data as well as our headers and index numbers of our items.

Loc Property

--

--

Jesse L
Jesse L

Written by Jesse L

Hi, I'm a passionate technology enthusiast and lifelong learner. Beyond my technical pursuits, I'm also passionate about sharing my enthusiasm with others.

No responses yet