0% found this document useful (0 votes)
7 views4 pages

Python Worksheet 2.4

The document outlines a practical programming experiment for a student named Satyam, focusing on the implementation of basic concepts using the Pandas library and bubble sort in Python. It includes code examples for creating a Pandas Series and DataFrame, as well as a bubble sort function to sort a list of integers. The learning outcomes highlight the student's understanding of the NumPy library, Matplotlib, and Python programming concepts.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views4 pages

Python Worksheet 2.4

The document outlines a practical programming experiment for a student named Satyam, focusing on the implementation of basic concepts using the Pandas library and bubble sort in Python. It includes code examples for creating a Pandas Series and DataFrame, as well as a bubble sort function to sort a list of integers. The learning outcomes highlight the student's understanding of the NumPy library, Matplotlib, and Python programming concepts.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

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 = np.array(["Apple","Orange","papaya","guavava"])

ser = pd.Series(data)

print(ser)
Data frame:
import pandas as pd

lst = ["Apple","Orange","papaya","guavava"]

df = pd.DataFrame(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 :"))

a.append(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. Matplotlib.pyplot 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

You might also like