Write a Pandas program to sort a given Series.
import pandas as pd s = pd.Series(['100', '200', 'python', '300.12', '400']) print("Original Data Series:") print(s) new_s = pd.Series(s).sort_values() print(new_s)
Sample Output:
Original Data Series: 0 100 1 200 2 python 3 300.12 4 400 dtype: object 0 100 1 200 3 300.12 4 400 2 python dtype: object
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer