Practical File
Practical File
import pandas as pd
import numpy as np
#making 1D array
array1=np.array([100,200,300,400,500,600])
s1=pd.Series(array1)
print(s1)
OUTPUT:
Q2 Given a Series print all the elements that are
above the 75th percentile.
import pandas as pd
# Sample series
data = pd.Series([10, 20, 30, 40, 50, 60, 70, 80, 90, 100])
output:
Q3 Write a program to generate a Series of 10
numbers with a scalar value of 777.
import pandas as pd
def Scalar_Series():
S1=pd.Series(777,index=range(0,11))
print(S1)
Scalar_Series()
output:
import pandas as p
data={'year1':100,'year2':200,'year3':300}
S1=p.Series(data)
print(S1)
Output:
Q5 Creating a Line Graph using matplotlib.
Ouput:
Q6 creating a bar graph using matplotlib.
Output:
Q7 Creating a histogram Graph using matplotlib.
plt.xlabel('Colors')
plt.ylabel('Number of Blocks')
plt.title('Number of Blocks by Color')
plt.show()
Output:
Q8 Create the following DataFrame Sales containg year
wise sales figures for five salespersons in INR. Use the
years as column labels and salesperson names as row
labels.