Class 12th CBSE

Given a series s1 with some values in it. Write a program to sort the values in descending order and store in s2 object, sort in ascending order and store in s3 object, store the squares of the series in s3 object, store the squares of the series values in s4 object, display s4 object values which are >7.

Solution: – 

import pandas as pd s1=pd.Series([5,7,9,11,13,2,4,3]) s2=s1.sort_values(ascending=False) s3=s1.sort_values s4=s1**2 print(s1[s1>7])

Fun & Easy to follow
Works on all devices
Your own Pace
Super Affordable

Popular Videos

UX for Teams

Learn the basics and a bit beyond to improve your backend dev skills.

ava4.png
Chris Matthews

Designer

SEO & Instagram

Learn the basics and a bit beyond to improve your backend dev skills.

ava4.png
Chris Matthews

Designer

Leave a Reply

Your email address will not be published. Required fields are marked *

sign up!

We’ll send you the hottest deals straight to your inbox so you’re always in on the best-kept software secrets.