DEV Community

Cover image for pandas, a Python library for data manipulation
kainat Raisa
kainat Raisa

Posted on

pandas, a Python library for data manipulation

How can a panda manipulate data?

When i first heard the name 'pandas' i wondered "how can these chubby animals work with data?". okay...i know that you are thinking how dumb i was. So now, if in Python 'pandas' are not some chubby entities then what is it???
pandas is a Python library which helps us to work with data. As we know that a code library is a collection of modules or functionalities which can be used by any programmer. Python is one of the languages which provide a huge variety of code libraries. pandas is one of the most helpful and important feature of Python which has made data manipulation way much easier for the tech-people who has to work with bulky datasets.

Image description

Why pandas?

Fields like Machine Learning, Artificial Intelligence, Deep Learning, Natural Language Processing, Data Science require a huge amount of data. These data can either be raw or organized data. pandas help us to visually represent the data in a comprehensible format.

Some fundamentals of pandas

Using pandas we can present a data set in a tabular format where all of the data are presented in rows and columns with corresponding row and column headings. In pandas this tabular format of data is called a DataFrame. We can pass CSV files,excel files or even dictionaries as a pandas Dataframe.
We can import pandas just like other python libraries with the import keyword. Here i am inporting pandas as pd( the most convenient abbreviation for pandas).

Image description
When we pass a dictionary inside a pandas DataFrame the keys correspond to the column names and values are the column elements.

Image description

Now we are going to pass the dictionary named "dict" inside a DataFrame and store the DataFrame in a variable named "df" (you can give any name to the variable). And we'll print the DataFrame df to see the output.

Image description
Yeeeyyyy! We have successfully created our first DataFrame.

Top comments (0)