Basic of Programming
Student Name: SATYAM
Subject Code: 21CAH653
UID: 21MCA3178 Section/Group: PH21MCA-5_B
Semester:2nd Date of Performance:15/04/2022
Experiment No. 8
1. Aim/Overview of the practical:
Task to be done:
Question-1: Write program to implement basic concepts in panda library.
Question-2: Write a program in python to read sort a list of integer
elements using
the bubble sort method. Display the sorted element on the screen.
2. Code for experiment/practical:
2.1) Question-1:
Series:
import pandas as pd
import numpy as np
data = [Link](["Apple","Orange","papaya","guavava"])
ser = [Link](data)
print(ser)
Data frame:
import pandas as pd
lst = ["Apple","Orange","papaya","guavava"]
df = [Link](lst)
print(df)
2.2) Question-2:
def bubbleSort(nlist):
for passnum in range(len(nlist)-1,0,-1):
for i in range(passnum):
if nlist[i]>nlist[i+1]:
temp = nlist[i]
nlist[i] = nlist[i+1]
nlist[i+1] = temp
a = []
n = int(input("Enter number of elements : "))
for i in range(0, n):
b = int(input("Enter the elements :"))
[Link](b)
bubbleSort(a)
print("sorted array is :",a)
3. Result/Output/Writing Summary:
3.1) Output for Question-1:
Series:
Data frame:
3.2) Output for Question-2:
Learning outcomes (What I have learnt):
1. NumPy library in python
2. [Link] library in python
3. classes, functions, methods in python.
Evaluation Grid:
Sr. No. Parameters Marks Obtained Maximum Marks
1. Demonstration and 5
Performance (Pre-Lab Quiz)
2. Worksheet 10
3. Post Lab Quiz 5