Apri il menu di navigazione
Chiudi suggerimenti
Cerca
Cerca
it
Change Language
Cambia lingua
Carica
Accedi
Accedi
Scarica gratis per giorni
0 valutazioni
Il 0% ha trovato utile questo documento (0 voti)
3 visualizzazioni
23 pagine
Ip Pallavi ....
Gb
Caricato da
purnimajaint1
Titolo migliorato con IA
Copyright
© © All Rights Reserved
Per noi i diritti sui contenuti sono una cosa seria. Se sospetti che questo contenuto sia tuo,
rivendicalo qui
.
Formati disponibili
Scarica in formato PDF o leggi online su Scribd
Scarica
Salva
Salva ip pallavi .... per dopo
0%
Il 0% ha trovato utile questo documento, undefined
0%
, undefined
Incorpora
Condividi
Stampa
Segnala
0 valutazioni
Il 0% ha trovato utile questo documento (0 voti)
3 visualizzazioni
23 pagine
Ip Pallavi ....
Gb
Caricato da
purnimajaint1
Titolo migliorato con IA
Copyright
© © All Rights Reserved
Per noi i diritti sui contenuti sono una cosa seria. Se sospetti che questo contenuto sia tuo,
rivendicalo qui
.
Formati disponibili
Scarica in formato PDF o leggi online su Scribd
Carosello precedente
Carosello successivo
Scarica
Salva
Salva ip pallavi .... per dopo
0%
Il 0% ha trovato utile questo documento, undefined
0%
, undefined
Incorpora
Condividi
Stampa
Segnala
Scarica ora
Scarica
Sei sulla pagina 1
/ 23
Cerca
Schermo intero
AIM: ‘To write a Python program to create a Series object that stores the Employee names as index and their Salary as values SQURCE CODE; Import pandas as pd Amport Bumpy as np Section=["A','B', 'C') ‘Contribution=np. array ((6700,5500,np.NaN]) Sepd. Series (datasContribution, index=section) print (8)‘Do you want to update the salary of the employecty/a}?:y ‘Enter the name of the employes: Am ‘Enter the mew salary: 58000, ‘Salary updated successfully!CREATING A PYTHON PROGRAM FOR MODIFYING OR UPDATING EXISTING VALUES OF SERIES OBJECT, AIM: To Write a Python program to create a Series object with Employee names as the index and their salaries as values. Accept the name of the employee whose salary needs to be changed, along with the new salary, and update it in the Series, Mamet input("Enter the name of the employee: ") Mame is 8: new salary = float{input{ Enter the new salary) [Mame] = new salary print(\aSalary updated successfully!) i eines Renee arson cetset Print{"\nEmployee not found in the records.") “ print{"\ Thane You!!!")SAMPLE OUTPUT: The Addition of two series cbject 4: a 12.0 b 25.0 ° Nan dtype: fleatea The Subtraction of two series object is: a 8.0 b 18.0 © Nan dtype: floatea ‘The Multiplication of two series object is: a 20.0 b 100.0 . Nan dtype: floatéa ‘The Division of two series object is: a 5.0 > 0 c NaN dtype: floatééPERFORMING MATHEMATICAL OPERATIONS ON SERIES OBIECTS AIM: To create a program in python to perform following mathematical Operations on Two Series objects: (i) Addition (ii) Subtraction (iii) Multiplication (iv) Division. pindexs{ a’, =pd. Series ({2,5],index=['a','b’)) Fint ("The Addition of two series object is:") int (61+82) int ("The Subtraction of two series object is:") -int (81-82) int ("The Multiplication of two series object i int (81*82) int ("The Division of two series object is:") int (81/82)ING A PYTHON PR¢ M FOR, EQUR ZONES USING SERIES. To write a Python program to create two series i.e. population and average income of Four Zones, and then calculate per capita income storing in third pandas series print it. Source Code; are | population=pd.Series([5200,2100,4523,3422}, inden=[ East’, West’, South’, Noxth’]) | avgincome=pd.Series([117832,587324,171802,235038},index=[ East’, West, South’, North] | perCapitalncome=avgincome/population print{'Pereapita Income of Four Zones are:") print("\n") Print{perCapitalncome)SAMPLE OUTPUT: The index of the Series is: Index([' The data type of the Series is: ints4 The size of the Series is: 5 is: (5,) False te'], dtype='object')CREATING A PYTHON PROGRAM TO DISPLAY ATTRIBUTES OF A SERIES, AIM: To write a Python program to create a Series using list and display the following attributes of the Series: (i) index (ii) dtype (iti) size (iv) shape (v) hasnans import pandas as pd ‘L=(10, 45,67,3,43] S=pd. Series (L,index=[ s'B','e", 'a",'8°1) Iprint ("The index of the Series is:",8, index) lpeint ("The data type of the Series is:",8.dtype)| Ipeint("The size of the Series is:",S.size) [print shape of the Series is:",S. shape) [print ("The NaN of the Series is:",S-hasnans)SAMPLE OUTPUT: Name Stul = Arun Stu2 Bala Stu3 Charan age 21 23 22NESTED LIST. ALM: To write a Python program to create a panda’s Data Frame for the following table Using Nested list: Name [Age | ‘stu [Arun 2 stu2 [sale 23 stus_|charan 22 SOURCE CODE: int (D) [import pandas as pd Le((*Arun',21),{'Bala’,23],{"Charan',221] (D=pd.DataFrame(L,index=['stul','stu2','Stu3"), column: "Name! , ‘Age! 1)SAMPLE OUTPUT: The details of Toys are: AP 7916 op (8508 MP 7226 uv. 1617 Name: Toys, dtype: int64 ‘The details of AP and OD are: Toys Books Uniform shoes 7916 61896 610 610 8508 8208 508 6798 ‘The details of MP and U.P are: Books Uniform 6149 ou. 6157 457 Consecutive 3 Rows and 3 Columns are: Toys Books Uniform AP 7916 61896 610 op 850% 08 508 M.P 7226 6149 611(CREATING A PYTHON PROGRAM FOR ACCESSING VALUES OF ROWS AND. COLUMNS OF A DATAFRAME, aM: To write a Python program to create a panda’s DataFrame called DF for the following table Using Dictionary of List and perform the following operations: toe | ate [ent | roe | soe [oe | ae thes @ To Display only column "Toys! from DataFrame DF. (8) To Display the row details of ‘AP’ and ‘OD’ from DataFrame DF (i) To Display the column "Books" and ‘Uniform’ for 'M.P" and ‘U.P" from DataFrame DF, (@) To Display consecutive 3 rows and 3 columns from DataFrame DF. SOURCE CODE: lagant panies oa pd [bet "toys (7926, 8608,7226,76171, ‘Boake s (61096, 6268 6245, 61892, Ontoew’ + (620,508, 612,457 , ‘Shoss'# (8810, 6788, 9615,64572) [beepa.atarrame(0,ndex=(‘A2°,/c0!, 4.8), °UPTSAMPLE OUTPUT: After Adding a new column Toys Books Uniform Shoes AP 7916 61896 610 8810 op 8508 «8208 508 6798 M.P 7226 «6149 611 9611 U.P 7617 6157 457 6457 After Deleting M.P details: Toys Books Uniform Shoes AP 67916 61896 610 10 op 8508 8208 508 6798 U.P 7617 6157 457 6457 Bags 5891 8628 9785 4475 Bags 5891 8628 4475AM: ‘To write a Python program to create a panda’s DataFrame called DF for the following table Using Dictionary of List and perform the following operations: a ras | a [ror (0 Insert a new column “Bags” with values as [5891, 8628, 9785, $475]. (i Delete the row details of M.P from DataFrame DF. 17916, 8508,7226, 7617), [61896,8208, 6149, 61571, ‘uniform’ (610,508, 611,457), "shoes: (8810, 6798, 9611,6457] ) [DP=p4.DataPrame (D,index={ AP! , 00", M.2',°V.2'}) [DF pags’ ]={5891, 8628, 9785, 4475] # Adding « new column Bags‘Sample Output: Original Detrrame ‘AP. Assam Sikkin TH AIMS. Fo 30 mat Lo 34 Mat Fees 28000 3300.0 27000923000 '15000.0 ‘Changing the name tom AP te Anam: ‘Andhra Assam Sikkiea TH AIMS. Fo 0 man ‘to 34 mam Fees 25000 93000.0 27000.0. 23000 150000 ‘Cousting and aisphaying noe-aN vatues of each colama: perreary Increasing the fees of al coteges by 6% “Ananra Assam ‘Sikkim TN AIMS ac ““i70 “60” MN 22.0" 7, Po 300 Maw 20 34.0 Haw TS 7180.0 7260 1000 46.0. 6730 Pees 26280.0 34650.0 28950.0 241500 18750.0 ‘Replacing all Nad values with O: ‘Aedhen Assam Siutin TN ANMS. PC 30.9 00 19 280 00 TS 7180.0 7260 1000. 46.0 6730 Pees 26280.0 94660.0 20950.0 2410.0 18750.(CREATING A PYTHON PROGRAM TO PERFORM OPERATIONS ON A DATAFRAME (RENAME. COUNT. UPDATE. REPLACE) AIM: ‘To write a Python program to create a pandas DataFrame to analyze number of Government and Private medical college and their Total seats Fees statewlse detalls using the dataset available at www.data.gov.in. Also, perform the following operations. (@ To Change the name of the state AP to Andhra. (@ To Count and Display Non-NaN values of each column. G@)_ To Count and Display Non-NaN values of each row. (| To Increase the fees of all colleges by 5% () To Replace all NaN values with 0.CREATING A PYTHON PROGRAM TO DISPLAY THE ATTRIBUTES OF A DATAFRAME AIM: To write a Python program to create a DataFrame using Dictionary of list and display the following attributes of the DataFrame: (i) index (ii) columns (iii) axes (iv) dtypes () shape (vi) dimension (vii) T ‘Degree'[’MBA',"MCA,/M.E',"M.Se], ‘Percent :[90,85,91,76)SAMPLE OUTPUT: # Output for Iterrows() Stu Name Anu Degree ver, Percentage 90 Name! 81, dtype: object 82 StuName Arun Degree MEA Percentage 85 Name: $2, dtype: object 33 ‘StuName Bala Degree ME Percentage 91 Name 83, dtype: ebject se ‘StuNane Charan Degree M.Se Percentage 76 Name: 84, dtype: object ss ‘StuName Mano Degree MEA Percentage 64 Bani 65; ctyper apace! # Output for Iteritems Stu Name si Anu 82 Arun 33 Bala St Charan 85 ‘Mano. Name: Stu Name, dtype: object Degree sl MBA S20 MCA 330 ME St M.S0 S50 MCA Name: Degree, atype: object Percentage a1 90 82 6s. 83 on st 76 ss a8 Name: Percentage, dtype: inté@To write a Python program to create a panda’s DataFrame called Students for the following table and demonstrate iterrows and iteritems. "Charan" ,"Mano"), "Degree" : "HBA", "HCA" Se" ,"MCA"], "Percentage": (90,85, 91,76,84]) ja", "84", "85")) DP=pd.DataFrame (D, index=["S1" , "2" for (row,values) in DP. iterrows (): print (row) print (values) print()#To print an empty line after each row, for (eol,values) in DP. iteritems (): print (col) print (values) print ()CREATING A PYTHON PROGRAM FOR PLOTTING PLOTTING HISTOGRAM AIM: To write a Python program to plot a Histogram for the following class interval or range. Also, give appropriate axes name, title and edege color as ‘red’. SOURCE CODE: [import matplotlib.pyplot as plt rks=[40, 60,55,20,35,70, 60,89,20,,33] lt. title("Maths Marks-Histogram of class XII") Lt.xlabel ("Mark Ranges") t.ylabel ("No.of Students") 1t-hist (Marks bins=[0,33,45, 60,100) ,edgecolor=' red’ Lt. show()
Potrebbero piacerti anche
Formulario Fondamenti Di Informatica
PDF
Nessuna valutazione finora
Formulario Fondamenti Di Informatica
36 pagine
FF - INF-LOG - Esercizi e Lez Python
PDF
Nessuna valutazione finora
FF - INF-LOG - Esercizi e Lez Python
33 pagine
Slides 06
PDF
Nessuna valutazione finora
Slides 06
60 pagine
ASP MI Lecture 3 NonParametricSE 2017 DPM
PDF
Nessuna valutazione finora
ASP MI Lecture 3 NonParametricSE 2017 DPM
101 pagine
Department of Computer Engineering: Fundamentals of Artificial Intelligence and Machine Learning Lab
PDF
Nessuna valutazione finora
Department of Computer Engineering: Fundamentals of Artificial Intelligence and Machine Learning Lab
47 pagine
Sycs Linear Algebra Practicals Semester - Iii
PDF
Nessuna valutazione finora
Sycs Linear Algebra Practicals Semester - Iii
24 pagine
RPubs - Enaho Con R
PDF
Nessuna valutazione finora
RPubs - Enaho Con R
43 pagine
Appunti Di Informatica
PDF
Nessuna valutazione finora
Appunti Di Informatica
68 pagine
Eserc 6 Marzo Slides Corso R Seconda Parte
PDF
Nessuna valutazione finora
Eserc 6 Marzo Slides Corso R Seconda Parte
26 pagine
RPractico
PDF
Nessuna valutazione finora
RPractico
28 pagine
Slides 10
PDF
Nessuna valutazione finora
Slides 10
39 pagine
04OpenData ASIDBMS
PDF
Nessuna valutazione finora
04OpenData ASIDBMS
19 pagine
Ai Lab1
PDF
Nessuna valutazione finora
Ai Lab1
14 pagine
Dati Struttura in Python
PDF
Nessuna valutazione finora
Dati Struttura in Python
30 pagine
1python1 AA
PDF
Nessuna valutazione finora
1python1 AA
36 pagine
Informe Diseño Logico
PDF
Nessuna valutazione finora
Informe Diseño Logico
16 pagine
Ref 1
PDF
Nessuna valutazione finora
Ref 1
9 pagine
Python
PDF
Nessuna valutazione finora
Python
26 pagine
Stata Manuale
PDF
Nessuna valutazione finora
Stata Manuale
246 pagine
CSS Exp3 4 5
PDF
Nessuna valutazione finora
CSS Exp3 4 5
12 pagine
Matrices in R
PDF
Nessuna valutazione finora
Matrices in R
13 pagine
QP 5
PDF
Nessuna valutazione finora
QP 5
12 pagine
DS Exp
PDF
Nessuna valutazione finora
DS Exp
4 pagine
CSE1012
PDF
Nessuna valutazione finora
CSE1012
22 pagine
Viva Voce
PDF
Nessuna valutazione finora
Viva Voce
23 pagine
Ai Lab4
PDF
Nessuna valutazione finora
Ai Lab4
9 pagine
Teorico 2
PDF
Nessuna valutazione finora
Teorico 2
7 pagine
Eserc 28 Febbr Slides Corso R Prima Parte
PDF
Nessuna valutazione finora
Eserc 28 Febbr Slides Corso R Prima Parte
22 pagine
Cs Viva Voce
PDF
Nessuna valutazione finora
Cs Viva Voce
23 pagine
Regresion Lineal Multiple
PDF
Nessuna valutazione finora
Regresion Lineal Multiple
22 pagine
Teorico - Practico Matrices Anaya
PDF
Nessuna valutazione finora
Teorico - Practico Matrices Anaya
18 pagine
Variante G
PDF
Nessuna valutazione finora
Variante G
11 pagine
Dizionari in Python
PDF
Nessuna valutazione finora
Dizionari in Python
4 pagine
CSS 1
PDF
Nessuna valutazione finora
CSS 1
20 pagine
Stat A Manual
PDF
Nessuna valutazione finora
Stat A Manual
297 pagine
Principali Funzioni Sage
PDF
Nessuna valutazione finora
Principali Funzioni Sage
11 pagine
S3a1 Estadistica
PDF
Nessuna valutazione finora
S3a1 Estadistica
20 pagine
Matematicas Con Scilab.
PDF
Nessuna valutazione finora
Matematicas Con Scilab.
115 pagine
Bda Task 8-9
PDF
Nessuna valutazione finora
Bda Task 8-9
8 pagine
Exp 20
PDF
Nessuna valutazione finora
Exp 20
3 pagine
Altri Comandi PANDAS
PDF
Nessuna valutazione finora
Altri Comandi PANDAS
2 pagine
Schmitt - Scritti Su Thomas Hobbes
PDF
Nessuna valutazione finora
Schmitt - Scritti Su Thomas Hobbes
108 pagine
Python Cheat Sheet-V2.4
PDF
Nessuna valutazione finora
Python Cheat Sheet-V2.4
3 pagine
Massimizzare La Varianza
PDF
Nessuna valutazione finora
Massimizzare La Varianza
7 pagine
Calcoli
PDF
Nessuna valutazione finora
Calcoli
2 pagine
Codigos BIG
PDF
Nessuna valutazione finora
Codigos BIG
3 pagine
Exp - 3 PB 51
PDF
Nessuna valutazione finora
Exp - 3 PB 51
6 pagine
OOP Imp Ques
PDF
Nessuna valutazione finora
OOP Imp Ques
10 pagine
Stencil Novelagrafica-1
PDF
Nessuna valutazione finora
Stencil Novelagrafica-1
2 pagine
Guida SQLite Con Python
PDF
Nessuna valutazione finora
Guida SQLite Con Python
34 pagine
Guida Codici Python
PDF
Nessuna valutazione finora
Guida Codici Python
2 pagine
Comando para Econometria Con R Studio
PDF
Nessuna valutazione finora
Comando para Econometria Con R Studio
5 pagine
Serie 7
PDF
Nessuna valutazione finora
Serie 7
9 pagine
Paradigma de Programación
PDF
Nessuna valutazione finora
Paradigma de Programación
4 pagine
Taller Vectores Unicamente
PDF
Nessuna valutazione finora
Taller Vectores Unicamente
2 pagine
Mapeo Lexicografico
PDF
Nessuna valutazione finora
Mapeo Lexicografico
2 pagine
Matematica Simbolica
PDF
Nessuna valutazione finora
Matematica Simbolica
8 pagine
Pin Dai 0001
PDF
Nessuna valutazione finora
Pin Dai 0001
2 pagine