1

I am trying to save my pandas series:

arr = [81, 9, 3, 42, 6, 4]
data = pd.Series(arr)
print(data.sort_values())

Result:

2     3
5     4
4     6
1     9
3    42
0    81

But when I try to get the first element:

arr = [81, 9, 3, 42, 6, 4]
data = pd.Series(arr)
X = data.sort_values()
print(X[0])

I get:

81

But I am looking to save the sorted array, i.e., I should get 3 (the smallest value).

Jan Trienes
  • 2,501
  • 1
  • 16
  • 28

0 Answers0