Search⌘ K
AI Features

Pandas

Explore how to use the Pandas Python library for data science, focusing on creating and manipulating DataFrames and Series. Learn to handle tabular data efficiently, reshape datasets, and prepare data for predictive modeling pipelines.

Pandas is a Python library built over the NumPy package. Its key data structure is Data-Frame. Data-Frame allows a user to store and manipulate data in a tabular format.

Pandas data structures are fast and flexible. They are suitable for working with real-world data problems, and they provide a good set of functions for data scientists and data engineers. These function help the user get a jump-start on their data, allowing them to quickly build a predictive modeling pipeline.

Pandas
Pandas

Creating a Pandas DataFrame

There are multiple ways to create a Pandas DataFrame.

By Python dictionary:

Python 3.5
#Import libraries
import pandas
#Create a dictionary
data_dictionary = {
"City":['Delhi','Bombay','Pune','Hyderabad'],
"Population_Index": [19,21,7,9],
"Area_Type":['Metro','Metro','Non-Metro','Metro']
}
#Create DataFrame
city_data = pandas.DataFrame(data_dictionary)
print(city_data)
...