Question: #1- Python exercise Create two Pandas Series and add, subtract, multiply and divide them. #Sample Series: [2, 4, 6, 8, 10], [1, 3, 5, 7,
#1- Python exercise
Create two Pandas Series and add, subtract, multiply and divide them.
#Sample Series: [2, 4, 6, 8, 10], [1, 3, 5, 7, 9]
a) Write a Python program to convert a dictionary to a Pandas series.
#Sample Series:
#Original dictionary:
#{'a': 100, 'b': 200, 'c': 300, 'd': 400, 'e': 800}
#Result, Converted series:
#a 100
#b 200
#c 300
#d 400
#e 800
b) Write a Python program to change the data type of given a column or a Series. The astype method will help you.
#Sample Series:
#Original Data Series:
#0 100
#1 200
#2 python
#3 300.12
#4 400
#dtype: object
#Result, Change the said data type to numeric:
#0 100.00
#1 200.00
#2 NaN
#3 300.12
#4 400.00
#dtype: float64
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
