Why is pd.Series called twice?
I think you could simply write it this way:
s = pd.Series(['100', '200', 'python', '300.12', '400'])
new_s = s.sort_values()
print(new_s)
I was going through some solutions for an online code for sorting a series . In this case, why is pd.Series called twice ? what is the point when it seems to create the same series?
import pandas as pd
s = pd.Series(['100', '200', 'python', '300.12', '400'])
print("Original Data Series:")
new_s = pd.Series(s).sort_values()
print(new_s)
also, why does pd.apply(pd.Series) create a Dataframe? Thank you!!