![]() |
VOOZH | about |
Pandas are the most popular python library that is used for data analysis. It provides highly optimized performance with back-end source code purely written in C or Python.
We can analyze data in Pandas with:
Series in Pandas is one dimensional(1-D) array defined in pandas that can be used to store any data type.
Here, Data can be:
Note: Index by default is from 0, 1, 2, ...(n-1) where n is the length of data.
Creating series with predefined index values.
Output:
Program to Create Pandas series from Dictionary.
Output:
Program to Create ndarray series.
Output:
The DataFrames in Pandas is a two-dimensional (2-D) data structure defined in pandas which consists of rows and columns.
Here, Data can be:
Program to Create a Dataframe with two dictionaries.
Output:
Here, we are taking three dictionaries and with the help of from_dict() we convert them into Pandas DataFrame.
Output:
A B C D 0 5 0 3 3 1 7 9 3 5 2 2 4 7 6
Program to create a dataframe of three Series.
Output:
One constraint has to be maintained while creating a DataFrame of 2D arrays - The dimensions of the 2D array must be the same.
Output: