CBSE Class 12 Informatics Practices Notes

Chapter 1 : Data Handling using Pandas

Introduction and creation of Series

From previous notes, it is now clear that series is an one dimensional labelled array, which is size mutable and value mutable. Let’s now look at different methods for creating a Series in Python. Make sure to import pandas library in a program before creating a series object.


Creating an empty series

For creating an empty series which have no data values, we will use Series( ) function as follows:

Seriesobject=pandas.Series()

As per above statement , no argument is to be given within Series( ) function. Given below is a code in which an empty Series S1 is created.

creating empty series in python pandas


Creating Series from a dictionary?

A dictionary is an unordered data type in which elements are present in key:value pair. As Series can also be created using a dictionary , in which all keys of the dictionary becomes the labels/index of series object and values of dictionary becomes data in a Series. In the example given above a series S is created using a dictionary d which contains 4 key and value pairs. When we print Series

Pandas for Data Analysis?

  1. It is very helpful in extracting meaningful set of information from big and bulky data sets.
  2. In pandas, data can be easily organised in a tabular structure containing rows and columns. This makes the analysis of data more simplified.
  3. It supports various data formats, like numbers, strings, decimals etc.
  4. Based on present set of data it also helps in predicting the future trends. So, it is therefore having TIME-SERIES functionality.

Welcome to your Quiz on Introduction to Pandas

1. 
What Pandas stand for?

2. 
Who developed Pandas library?

3. 
Which is the correct way to import pandas library?