Online Python Compile3r (Interpreter) - Programiz
Online Python Compile3r (Interpreter) - Programiz
Programiz PRO
Python Online Compiler
main.py Output
23 print(MonthDays)
24 #6. Using the Series created in Question 5, write commands for the following:
25 #a) Set all the values of Vowels to 10 and display the Series.
26 Vowels[:] = 10
27 print(Vowels)
28 #b) Divide all values of Vowels by 2 and display the Series.
29 Vowels = Vowels / 2
30 print(Vowels)
31 #Create another series Vowels1 having 5 elements with index labels 'a', 'e',
'i', 'o', 'u' having values [2, 5, 6, 3, 8] respectively.
32 Vowels1 = pd.Series([2, 5, 6, 3, 8], index=['a', 'e', 'i', 'o', 'u'])
33 print(Vowels1)
34 # Add Vowels and Vowels1 and assign the result to Vowels3.
35 Vowels3 = Vowels + Vowels1
36 print(Vowels3)
37 # Subtract, Multiply and Divide Vowels by Vowels1.
38 Vowels_sub = Vowels - Vowels1
39 print("Subtraction:\n", Vowels_sub)
40
41 Vowels_mul = Vowels * Vowels1
42 print("\nMultiplication:\n", Vowels_mul)
43
44 Vowels_div = Vowels / Vowels1
45 print("\nDivision:\n", Vowels_div)
46 #Alter the labels of Vowels1 to ['A', 'E', 'I', 'O', 'U'].
47 Vowels1.index = ['A', 'E', 'I', 'O', 'U']
48 print(Vowels1)
Run
https://www.programiz.com/python-programming/online-compiler/ 1/1