Download as pdf or txt
Download as pdf or txt
You are on page 1of 25

INFORMATICS PRACTICES

(065) PRACTICAL FILE


Session 2023-2024

NAME : DAKSH
CLASS : 12th
ROLL NO : 26627897
SUBMITTED TO : Mr. SUBHASH SINGH
INDEX
S. No CONTENT SIGN
1. Create a table named prince having columns student id, name,
class, marks, tuition fee.

2. Insert 10 values in the table named prince.

3. Use various types of multi row function in table named prince .

4. Add a New column(email id) into existing table named prince.

5. Add values in new column(email id) into existing table named


prince.
6. Apply the function order by on the table named prince.

7. Apply the function group by on the table named prince.

8. Apply the function truncate on the table named prince.

9. Apply the date function on the table named prince.

10. Apply the function upper and lower on the table named prince.

11. Creating Line Graph using Matplotlib.

12. Creating Bar Graph using Matplotlib.

13. Creating Histogram Graph using Matplotlib.

14. Create a pandas series from dictionary of value.

15. Give a series , print all the elements that are above the
75th percentile.
16. Create a panda’s series from a dictionary of values and a ndarray.

17. Write a program to generate a series of 10 numbers


with a scalar value of 44.

18. Create the following DataFrame Sales containing year wise sales
figures for five salespersons in INR. Use the years as column
labels, and salesperson names as row labels.
.
OUTPUT
OUTPUT
OUTPUT
OUTPUT
OUTPUT
import pandas as pd
def fl_scv():
print(pd.Series(44,range(1,11))
)
fl_scv()

output

OUTPUT
import pandas as pd
import numpy as
np def pro3():
#Creating series from a
dictionary
d={'Jan':31,'Feb':28,'Mar':31,'Apr':3
0}
s=pd.Series(d)
print("Series from dictionary")
print("~~~~~~~~~~~~~~~~~~~~~~~")
print(s)
#Creating series from an
ndarray ar=np.array([2,3,4,5,6])
print("\nSeries from ndarray")
print("~~~~~~~~~~~~~~~~~~~~~~~")
s1=pd.Series(ar)
print(s1
) pro3()

OUTPUT
2018 2019 2020 2021

Kapil 110 205 177 189

Kamini 130 165 175 190

Shikhar 115 206 157 179

Mohini 118 198 183 169

1. Create the DataFrame.


2. Display the row labels of Sales.
3. Display the column labels of Sales.
4. Display the data types of each column of Sales.
5. Display the dimensions, shape, size and values of Sales.
import pandas as pd
d = {2018:[110,130,115,118],
2019:[205,165,175,190],
2020:[115,206,157,179],
2021:[118,198,183,169]}
sales=pd.DataFrame(d,index=['Kapil','Kamini','Shikhar','Mohi
ni']) #Display row lables
print("Row Lables:\n",sales.index)
print("~~~~~~~~~~~~~~~~~~~~~~~~~~\n")
print("Column Lables:\n",sales.columns)
print("~~~~~~~~~~~~~~~~~~~~~~~~~~\n")
print("\nDisplay column data types")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~")
print(sales.dtypes)
print("\nDisplay the dimensions, shape, size and values of
Sales") print("~~~~~~~~~~~~~~~~~~~~~~~~~~")
print("Dimensions:",sales.ndim)
print("Shape:",sales.shape
) print("Size:",sales.size)
print("Values:",sales.value
s)

You might also like