Considering the DataFrame created in Program 13 and present the sales of the east region

Class 12th CBSE IP Considering the DataFrame created in Program 13 and present the sales of the east region Solution: –  import matplotlib.pyplot as plt import pandas as pd dict1={‘north’:[110,150,230,400], ‘east’:[200,90,150,350] } df=pd.DataFrame(dict1, index=[‘April’,’May’,’june’,’July’]) print(df) df[‘east’].plot(kind=’barh’, color=[‘green’]) plt.title(“East Region Sales Month wise”,fontsize=14,color=”blue”) plt.xlabel(“Sales”,fontsize=14,color=”red”) plt.ylabel(“Month”,fontsize=14,color=”red”) plt.xticks(fontsize=10, rotation=30) plt.show() Fun & Easy to follow Works on all […]

Write a program to read details such as item sales made in a DataFrame and then store this data in a csv file.

Class 12th CBSE Write a program to read details such as item sales made in a Data Frame and then store this data in a csv file. Solution: –  import pandas as pd c={‘Fridge’:[12],’Cooker’:[5],’Juicer’:[15],’Iron’:[11]} df= pd.DataFrame(c) print(df) df.to_csv(‘file.csv’) Fun & Easy to follow Works on all devices Your own Pace Super Affordable Popular Videos https://www.youtube.com/watch?v=9uOETcuFjbE […]

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.

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, […]

Write a python program to create a DataFrame with custom column name/index.

Class 12th CBSE Write a python program to create a DataFrame with custom column name/index. Solution: –  import pandas as pd myList = [[‘Ashima’,12],[‘Mannat’,14],[‘Samidha’,15],[‘Jai’,16]] myDataFrame = pd.DataFrame(myList,columns=[‘Name’,’Roll No’]) print(myDataFrame) Fun & Easy to follow Works on all devices Your own Pace Super Affordable Popular Videos https://www.youtube.com/watch?v=9uOETcuFjbE UX for Teams Learn the basics and a bit […]

Write a python program to show the use of where condition using Series

Class 12th CBSE IP Write a python program to show the use of where condition using Series. Solution: –  import pandas as pd myDict= {1:10,2:20,3:30} myDict2= {1:’Ajay’,2:’Dheeraj’,3:’Shanku’} print(myDict) mySeries=pd.Series(myDict) mySeries2=pd.Series(myDict2) print(mySeries) print(mySeries.where(mySeries > 10)) print(mySeries.where(mySeries < 20)) print(mySeries.where(mySeries == 10)) print(mySeries.where(mySeries == 10,33)) print(mySeries.where(mySeries != 10,33)) print(mySeries2) print(mySeries2.where(mySeries2 == 'Ajay')) print(mySeries2.where(mySeries2 != 'Ajay')) print(mySeries2.where(mySeries2 == […]

Write a python program to show the use of header and tail methods of Series.

Class 12th CBSE IP Write a python program to show the use of header and tail methods of Series. Solution: –  import pandas as pd myDict= {1:’Mannat’,2:’Samidha’,3:’Jai’,4:’Kalk’,5:’Abhishek’,6:’Yuvesh’} print(myDict) mySeries=pd.Series(myDict) print(mySeries) print(mySeries.head(2)) print(mySeries.tail(2)) Fun & Easy to follow Works on all devices Your own Pace Super Affordable Popular Videos https://www.youtube.com/watch?v=9uOETcuFjbE UX for Teams Learn the basics […]

Write a python program to create a Series Object

Class 12th CBSE IP Write a python program to create a Series Object Solution: –  import pandas as pd mySeries = pd.Series([10,20,30]) mySeries1 = pd.Series([10,20,30],index=[5,6,7]) print(mySeries) print(mySeries1) print(mySeries+mySeries) Fun & Easy to follow Works on all devices Your own Pace Super Affordable Popular Videos https://www.youtube.com/watch?v=9uOETcuFjbE UX for Teams Learn the basics and a bit beyond […]

Write a python program to create a DataFrame for examination result and display row labels, column labels data types of each column and the dimensions.

Class 12th CBSE IP Write a python program to create a Data Frame for examination result and display row labels, column labels data types of each column and the dimensions. Solution: –  import pandas as pd df=pd.DataFrame() df[‘Name’]=[‘A’,’B’,’C’,’D’] df[‘Class’]=[12,10,11,12] df[‘Mrks1’]=[88,85,89,90] df[‘Mrks2’]=[55,67,97,87] df[‘Mrks3’]=[77,75,74,73] print(df) print(df[‘Name’].shape) Fun & Easy to follow Works on all devices Your own […]

sign up!

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