Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
20 views
Practical file 12th
Practical file.
Uploaded by
vikassolanki110new
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Practical file 12th For Later
Download
Save
Save Practical file 12th For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
20 views
Practical file 12th
Practical file.
Uploaded by
vikassolanki110new
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Practical file 12th For Later
Carousel Previous
Carousel Next
Download
Save
Save Practical file 12th For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 19
Search
Fullscreen
PYTHON PROGRAMS Questions Createa series of these numbers:33,55,65,29,19,23. reatea series of 10 numbers starting with 41 and with the increment of 3. Create a series of 10 numbers using ndarray. Create a series and print the top 3 and bottom 3 elements using the head and tail functions. Write code to show al attributes of series. Use seriesin QI. Use Series created in Q2 ad find output of following commands:- sf:2), s[1:3] & s[[1,3,4]]. Write code to change value 29 and 23 from series Q1. Write code to sort series in descending order-(Use Q3). Create a dataframe countries using a dictionary which stored 5 country name, capitals and populations of the country. Index will be years. Write a program to show alll attributes of dataframe created in Q9. Create a dataframe players to store 10 players with their highest and lowest score no_of matches columns. Player names are indices of dataframe. Perform following questions:- 1a) Show data of any two players using loc function. 1b) Show any two columns. c) Show data of two rows and two colurans using loc function. d)Make use of rename command to change column name no_of matches to Matches played. e) Drop rowof last player. ‘Make multiple bar graph for dataframe created in Q11. Create line graph for temp. seven days of week. Create histogram to show salesof one month data. Createcsv file from dataframe players. Make sure null values arehandled properly. Create csv file in excel. Open csv in dataframe, Make use of nrows ‘command. Create database DATA Create the following table product Table: Products Apple Sony Philips iPhone LED TV Bluetooth Speaker Show table structure, ‘Show records of table products. Show products of pcode P1001 and P1005, ‘Show data of products starting with i ‘Show data ofall products whose quantity>50 and price>30000. |Show sum of price ofall products. Show product names in upper case and also length of all products. ‘Show product name and qty joined with space under heading “Product and Qty”. Fra Display first2 and last2 letters from Pname. Write queries using emp! table: ‘Show totalemployeesworking ineach department. ‘Show avg salary of each job ‘Show min salary of each department where minimum employees are > 3. Write queries using empl and dept table: ‘Show employee names and location of job. ‘Show avg salary of employees working in sales department. ‘Show ename, salary,dname, and location and all employees. ED” ‘current date and time. Display day of week, day ofyear and day name for current date. a drop the table product 5PYTHON PROGRAM 1) Create a series of these numbers: 33,55,65,29,19,23. cope: import pandas as pd 1d Series({33,55,65,29,19,23]) print(s1) ‘ouTPu’ Cleo ir) 2) Create aseries of 10 numbers starting with 41 and with the increment of. cope: import pandasas pd sn= 41 im=3 af] for iin range(10}: a.append(sn) sn= sneim 1d Series(a) print(m) ouTpuT:- oye UL3) Createa series of 10 numbers using ndarray. CODE: import pandas as pd import numpy as np \d.Series(np.arange(1, 11) print(s) OUTPUT:- dtype: inté4 4) Create a series and print the top 3 and bottom 3 elements using the head and tail functions, CODE: import pandas as pd 10, 20, 30, 40, 50, 60, 70, 80, 90, 100] d.Series(s) print(s1.head(3)) print(s1.tail(3)) ouTPUT-5) Write CODE to show all attributes of series. Use series created in Q1. CODE import pandas as pd 5=pd.Series([33,55,65,29,19,23]) print(s5{:]) ouTpur:- Cie 6) Use Series created in Q2 and find OUTPUT of following commands: s{: :2] s[1:3] s{{1,3,4]] CODE: print{m{::2]) print(m{2:3)) print(m({2,3,4]]) OUTPUT:- 8 Cie Uns rel ar) Clover ns cer) ce Cisvoceme UnsWrite CODE to change value 29 and 23 from series of Q1. cope: import pandas as pd si=pd.Serles([33,55,65,29,19,23}) s1[3]=30 s1(5]=28 print(s1) ourpur:- Chey eee Cet) Write CODE to sort series in descending cope: import pandas as pd Import numpy as np s=pd.Serles(np.arange(1, 11)) print(s) s=s.sort_values(ascending=False) print(s) ourpur: as order-(Use — Q3).9) Create a dataframe countries using a dictionary which stored 5 countryname, capitals and populations of the country. Index will be years, cove import pandas as pd countrles= pd.DataFrame(({ ‘Country’: ['USA’, ‘Canada’, 'UK’, ‘Germany, 'France'], ‘capital’: [Washington D.C. 'Ottawa', ‘London’, ‘Berlin’, "Paris'], ‘Population’: (331002651, 37742154, 67886011, 83783942, 65273511] 3), ['2021 1021','2022', '2023','2024']) print{cou ntries) OUTPUT- fers) Capital Population ry Ut cee BER. feTT Tr Chae) Brae vaLs UK OE aa Sg ed 10) Write program to show all attributes of dataframe created in Q9. cope: import pandas as pd import numpy as np ‘Country’: ['United States’, France’, ‘Brazil, Japan’, ‘Australia'], ‘Capital’: ['Washington, D.C. ‘Paris’, ‘Brasilia’, ‘Tokyo’, 'Canberra'], ‘Population’: (1000000, 2000000, 1500000, 2500000, 1800000]} $10 = pd.DataFrame(data, index=[2020, 2021, 2022, 2023, 2024]) print(S10[:]) ouTPUT- Cars: United state Peery11) Create dataframe players to store 10 players with their highest and lowest score no_of matches columns. Player names are indices of dataframe. perform following questions:- a) Show data of any two players using loc function. b) Show any two columns. )Show data of two rows and two columns using loc function. d) Make use of rename command to change column name no_of_matches to Matches_played €) drop row of last player. cope: import pandas as pd players=pd.DataFrame( { ‘layer’: ['Playert!, 'Player2', 'Player3', 'Player4!, 'Players', 'Player6', 'Player7’, ‘Players’, ‘Players, 'Player10', 'Highest_Score’: (98, 89, 95, 87, 99, 92, 96, 90, 88, 94], ‘Lowest_Score’: [45, 55,50, 42, 48, 51,46, 56, 49, 47], 'Matches_played': (30, 35, 32, 33,31, 29, 34, 30, 36, 37] y players.set_index('Player’, inplace=True) print(‘a)Show data of any two players usingloc function’) print(players.loc{{'Player1’, 'Player3"]}) print('b}Show any two columns’) print(players{{'Highest_Score’, 'Lowest_Score'}}) print('c) Show data of two rows and two columns using loc function’) print(players.loc{{'Player2', Players'], [‘Highest_Score’, 'Lowest_Score']]) print('d) Make use of rename command to change column name no_of_matches to Matches_played') players.rename(columns={'Matches_played’: ‘no_of_matches'}, inplace=True) print('Drop the row of the last player’) players.drop('Player10’, inplace=True) print('Displaythe updated DataFrame') print(players) OUTPUT:-12) Make multiple bar graph for dataframe created in Q.11 CODE: Import pandas as pd import matplotlib.pyplot as pit players = pd.DataFrame({ ‘Player’: ‘Player’, 'Player2’, 'Players', Player4’, ‘Players’, ‘Players’, 'Player7’,'Player8', ‘Player9', 'Player10'], "Highest_Score': [98, 89, 95, 87,99, 92, 96, 90,88, 94], "Lowest_Score':[45,55, 50, 42, 48, 51,46, 56, 49, 47], 'Matches_played': [30, 35, 32, 33, 31, 29, 34, 30, 36, 37] » players.set_index('Player', inplace=True) players{['Highest_Score’, '‘Lowest_Score']].plot(kind="bar, figsize=(10, 6)) pit.title('Highest and Lowest Score for Players’) pltxlabel('Players') pltyylabel('Scores') plt.xticks(rotation=45) plt.show() OUTPUT:- OM hk he Oe CE13) Create line graph for temp. of seven days of week CODE: Import matplotlib.pyplot as plt days_of_week = ['Monday,, ‘Tuesday’, ‘Wednesday’, ‘Thursday, ‘Friday’, ‘Saturday’, ‘sunday'] temperature = [65, 68, 70, 72, 59, 57, 73] pit.plot(days_of_week, temperature, marker='o', inestyl pit-title("Temperature for Seven Days of the Week’) pit.xlabel('Day of the Week’) pit.ylabel('Temperature (°F)') pit.show() ourpuT:- ‘Temperature for Seven Days of the Week ‘Monday Tuesday Wednesday Thursday friday Saturday Sunday Day of the Week14) Create histogram to show sales of one month data. cope: import matplotlib.pyplot as pit sales_data = (110, 125, 125, 145, 135, 115, 110, 120, 135, 140, 130, 130, 140, 175, 135, 145, 125, 135, 140, 150, 140, 130, 160, 155, 125, 160, 140, 145] pit hist(sales_data, bins=15, edgecolor="y') plt.title('Sales Histogram for One Month’) pit.xlabel('Sales Amount’) pit.ylabel('Frequency') pit.show() OuTPUT:- Sales Histogram for One Month uo 080 Sales Amount15) Create csv file from dataframe players, Make sure null valuesare handled properly. cope: players=pd.DataFrame( { ‘Player’: [’Playert', 'Player2’, 'Player3', ‘Player4’, 'PlayerS', ‘Players’, 'Player7’, 'Player8','Player9', 'Player10'), 'Highest_Score': [100, 150, 80, None, 200, 90, 110, 130, None, 170}, "Lowest _Score': [30, 40,20, 50, 60, 35, 25, None, 55, 70], 'Matches_played': [50, None, 60, 55, 40, 48, None, 42, 47, 49] a) players.set_index('Player', inplace=True) players=players.fillna(‘N/A’) players.to_csv(‘players_data.csv’) ourPuT:- ayer Mighest Score Lowest Score Ne of Mathes 40WA « 0 2 16) Create csv file in excel. Open csv in dataframe. Make use of nrows ‘command, CODE: Import pandas as pd Df=pd.read_csv(‘csv.csv’,nrows=5) print(0f) UTPUT:- Population Hospitals Schools Govt_officers Multiplex Malls 123415121 132-3871 54152 15247 45364 165345345 195 4025 «315427 2444287645 214763548 1001258 2457515284 51470 514582475 «145.1240 43200 © 433351433Create the following table products. i eee AM Stoo P1001 | iPad 120| 15000] Apple P1002| LEDTV__| 100| 85000| Sony DSLR P1003 | Camera 10 | 25000] Philips P1004| iPhone__| 50 | 95000] Apple P1005 LEDTV__| 20 | 45000] MI. Bluetooth Speaker P1006 100] 20000] Ahuja 16Show table structure. 1) Ose i Ee Cees U Me ae DSc eae ose aT rely urs e3] Lae varchar(20) ree | Crete I pt | Dae | | | i] is] | Price | int rae Company | varchar(10) na ws in set (0.06 si 2) Show records oftable products. eee ees R rr are Pcode | Pname eT) PEO) 25000 rT) 3) Ee mer ett ae me TM rr tes -> where Pcode in ('P1001', 'P1005'); " | Company | iPad | 120 | 15000 LED Tv | 20 | 45000 + 7Cel eee ee eer ad Se eae Se Cua os + 5060 | Apple | Cee yacd NEE eet eae et mee ta Sse) se OME Bs
select sum(Price)"Total_Price" from Products; = " | Total_Price | 18'8) Show product name and qty joined with space under heading “product and Qty’ er Enemy PM Sse or ers resets i i ote f eRe | | DSLR Camera | eo | etc eves) | te I rons in set (0.60 1910) Write queries usingemp! table: in set (0.00 sec) cl ory tr ea Er mets Show min salary of each department where minimum employees are>3. mysql> select deptno , min(sal) from enpl Seren mC CMe eur meu Cuet Een rows in set (0.60 sec 2011) Write queries ising empl and dept table Show employee names and their location of job Sec ee eee cee er et SCS ments on oma eee Cae mer Cee CS CET or et SETH on Ce ar BINA en re ee, select avg(sal) from empl e, dept PO eRe Lr er ac | " | 5 ce careers Peers ara 7 SALES SETH air ase | Reig orn | KOLKATA marys | KOLKATA onc se: ers | NEW DELK ocr eis ery mera. a SHIVANSH | 2U50 Raa ees ANIR Emme isc rg fin eee Brrr erm ae ie Eee aa Pea) cant Semel is Crd 212) Display current date and time. mysql> SELECT NOW()"Current_Date_Time"; ce | Current_Date_Time a Hy chad fh 22
You might also like
IP Practical File 2024-25
PDF
100% (6)
IP Practical File 2024-25
22 pages
Pandas Practicals - Term-1
PDF
100% (1)
Pandas Practicals - Term-1
18 pages
Ip Practical File
PDF
No ratings yet
Ip Practical File
21 pages
Ip Final Practical File
PDF
No ratings yet
Ip Final Practical File
22 pages
ip 12th practical
PDF
No ratings yet
ip 12th practical
22 pages
Practical file 12.
PDF
No ratings yet
Practical file 12.
22 pages
IP practical file 2022
PDF
No ratings yet
IP practical file 2022
26 pages
Practical - With Solution - XII - IP
PDF
No ratings yet
Practical - With Solution - XII - IP
13 pages
Pragya File
PDF
No ratings yet
Pragya File
31 pages
IP Practical File - Reference
PDF
No ratings yet
IP Practical File - Reference
98 pages
12 IP Practical Exampl
PDF
No ratings yet
12 IP Practical Exampl
6 pages
CLASS XII - IP List of Practicals with Coding 2020
PDF
No ratings yet
CLASS XII - IP List of Practicals with Coding 2020
15 pages
Nitya Practical File Class Xii 2023-2024
PDF
No ratings yet
Nitya Practical File Class Xii 2023-2024
41 pages
12 Ip HW
PDF
No ratings yet
12 Ip HW
10 pages
Practical File 2024
PDF
No ratings yet
Practical File 2024
25 pages
Record File Work
PDF
No ratings yet
Record File Work
34 pages
12 IP Practical
PDF
No ratings yet
12 IP Practical
14 pages
Python Practical Questions
PDF
No ratings yet
Python Practical Questions
13 pages
Practical File Question 28.09.2022
PDF
No ratings yet
Practical File Question 28.09.2022
15 pages
List of Practicals Python 2024 - 25
PDF
No ratings yet
List of Practicals Python 2024 - 25
13 pages
Python Project File
PDF
No ratings yet
Python Project File
31 pages
IP Practical
PDF
No ratings yet
IP Practical
28 pages
Practical 1
PDF
No ratings yet
Practical 1
65 pages
Holidays Homework - Ip
PDF
No ratings yet
Holidays Homework - Ip
5 pages
IP Practical File
PDF
No ratings yet
IP Practical File
27 pages
Python Programs
PDF
No ratings yet
Python Programs
29 pages
Practical Record 2 PYTHON AND SQL PROGRAMS - 2023
PDF
No ratings yet
Practical Record 2 PYTHON AND SQL PROGRAMS - 2023
76 pages
Class Xii Ip Practical File Ankit
PDF
No ratings yet
Class Xii Ip Practical File Ankit
28 pages
ANNANYA 12B (Practical File)
PDF
No ratings yet
ANNANYA 12B (Practical File)
36 pages
DATAFRAME
PDF
No ratings yet
DATAFRAME
6 pages
Xii - Ip - Holiday HW
PDF
No ratings yet
Xii - Ip - Holiday HW
2 pages
VSG Ip Practical Index-1
PDF
No ratings yet
VSG Ip Practical Index-1
4 pages
Ankit Class 12 Practical File
PDF
No ratings yet
Ankit Class 12 Practical File
33 pages
Practical File 2024-25
PDF
No ratings yet
Practical File 2024-25
25 pages
Journal 12
PDF
No ratings yet
Journal 12
54 pages
Suryadatta National School Class 12 CBSE Informatics Practices Practicals List
PDF
No ratings yet
Suryadatta National School Class 12 CBSE Informatics Practices Practicals List
19 pages
Class XII IP Summer Assignment
PDF
No ratings yet
Class XII IP Summer Assignment
5 pages
Practical File Part 1
PDF
No ratings yet
Practical File Part 1
17 pages
IP Practical 2023-24 (1 To 34)
PDF
100% (1)
IP Practical 2023-24 (1 To 34)
32 pages
Matplotlib linechatsy
PDF
No ratings yet
Matplotlib linechatsy
38 pages
Ip Project Work 2
PDF
No ratings yet
Ip Project Work 2
52 pages
PRACTICALS
PDF
No ratings yet
PRACTICALS
52 pages
Practical File (Class 12)
PDF
No ratings yet
Practical File (Class 12)
18 pages
12 Ip Practical List With Solution Complete
PDF
No ratings yet
12 Ip Practical List With Solution Complete
5 pages
Practical Record Programs - Solutions
PDF
No ratings yet
Practical Record Programs - Solutions
23 pages
IP Record Final-1
PDF
No ratings yet
IP Record Final-1
34 pages
XII IP Board Practical File
PDF
No ratings yet
XII IP Board Practical File
7 pages
3 Marks Class 12
PDF
No ratings yet
3 Marks Class 12
11 pages
Practical-file-12 IP 24-25
PDF
No ratings yet
Practical-file-12 IP 24-25
49 pages
Khadeeja_DS_PRACTICAL 4
PDF
No ratings yet
Khadeeja_DS_PRACTICAL 4
24 pages
Practical Xii 11-25
PDF
No ratings yet
Practical Xii 11-25
14 pages
IP Practical File Project
PDF
No ratings yet
IP Practical File Project
60 pages
11745063235731
PDF
No ratings yet
11745063235731
49 pages
Practical File IP Class 12 2022 23
PDF
No ratings yet
Practical File IP Class 12 2022 23
49 pages
11377681249398
PDF
No ratings yet
11377681249398
49 pages
11722121469601
PDF
No ratings yet
11722121469601
49 pages
11688821574779
PDF
No ratings yet
11688821574779
49 pages
Ip Practical Index
PDF
No ratings yet
Ip Practical Index
6 pages
Ds File
PDF
100% (1)
Ds File
40 pages