Member-only story
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.