How to perform Various Operations on Pandas Series | Pandas Data Structure Series | Pandas Tutorial

preview_player
Показать описание
Pandas Series is a one-dimensional labeled array in Pandas that can hold data of any type, such as integers, floats, strings, booleans, and other objects. Pandas provides many methods and functions to perform various operations on Series. Here are some of the most common operations you can perform on a Pandas Series:

Create a Series: You can create a Pandas Series using the pd.Series() function and passing a Python list or NumPy array as input. For example:

import pandas as pd
s = pd.Series([10, 20, 30, 40])
print(s)

Access elements: You can access elements of a Series using indexing or slicing. For example:

print(s[0]) # Output: 10
print(s[1:3]) # Output: 20 30

Perform arithmetic operations: You can perform arithmetic operations on Series, such as addition, subtraction, multiplication, and division. For example:

s = s + 5
print(s) # Output: 15 25 35 45
Apply functions: You can apply various functions to a Series, such as sum(), mean(), max(), min(), and std(). For example:

Filtering: You can filter a Series based on a condition using boolean indexing. For example:

print(s[s == 35]) # Output: 35

Sorting: You can sort a Series by values using the sort_values() function. For example:

Unique values: You can get the unique values in a Series using the unique() function. For example:

s = pd.Series(['apple', 'banana', 'cherry', 'apple', 'banana'])

@ParagDhawan
Here

empty attribute

se = pd.Series()
print(se)

print(" is the object empty ")

axes attribute

print(s2)
print("The axes are: ")

How to get dimension of series

s = pd.Series([1,2,3,4,5], index=['a','b','c','d','e'])
print(s)

print('print the dimension of the object')

How to get Size (Number of elements in Series)

s = pd.Series([1,2,3,4,5], index=['a','b','c','d','e'])
print(s)
print('print the size of object')

How to get Actual Values of seires
print ('the actula data series is :')

Getting top N elements of Series
print("Print the first two elemnts of the data series")

Getting Last N elements of series
print("print the last two element of the data series")

=============================================================================
Link for Tutorial Series

Jupyter Notebook Tutorial Series:-

Python Tutorial Series:-

Python Assignments and Objective Questions:-

Tech. Videos By Parag Dhawan;-

Object-Oriented Programming in Python:-

File Handling in Python:-

Exception Handling in Python:-

NumPy Tutorial Series:-

=============================================================================
Feel free to connect and ask your queries:-

=============================================================================
Show your support by Subscribing to the channel:-
=============================================================================

#ParagDhawan
#Pandas
#DataScience
#DataAnalysis
#PandasTutorial
#PandasCourse
#Python3
#Python
#PythonProgramming

============================================================
How to Record Your Screen and make a tutorial video or demo video: -
============================================================
Рекомендации по теме