Question: #4- Write a Python Pandas program to convert the first column of a DataFrame as a Series. #Sample Output: #Original DataFrame #col1 col2 col3 #0

#4- Write a Python Pandas program to convert the first column of a DataFrame as a Series.

#Sample Output:

#Original DataFrame

#col1 col2 col3

#0 1 4 7

#1 2 5 5

#2 3 6 8

#3 4 9 12

#4 7 5 1

#5 11 0 11

#Result, 1st column as a Series:

#0 1

#1 2

#2 3

#3 4

#4 7

#5 11

#Name: col1, dtype: int64

#

b) Write a Pandas program to convert a given Series to an array.

#Sample Output:

#Original Data Series:

#0 100

#1 200

#2 python

#3 300.12

#4 400

#dtype: object

#Result, Series to an array/list

#['100' '200' 'python' '300.12' '400']

#6- Write a Pandas program to sort a given Series.

#Sample Output:

#Original Data Series:

#0 100

#1 200

#2 python

#3 300.12

#4 400

#dtype: object

#Result:

#0 100

#1 200

#3 300.12

#4 400

#2 python

#dtype: object

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!