Series() is a function present in the Pandas library that creates a one-dimensional array and can hold any type of objects or data in it. In this article, let us learn the syntax, create and display one-dimensional array-like object containing an array of data using Pandas library.
Syntax : pandas.Series(parameters)
- data : Contains data stored in Series.
- index : Values must be hashable and have the same length as data.
- dtype : Data type for the output Series.
- name : The name to give to the Series.
- copy : Copy input data.
Returns : An object of class Series
Example 1 : Creating Series from a list
Example 2 :Creating a Series from a NumPy array.
Example 3: Creating a Series from a dictionary.
Example 4 :Creating a Series from list of lists.
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course