Pandas Index의 최대값을 반환하려면 index.max()를 사용하세요. 방법. 먼저 필요한 라이브러리를 가져옵니다. -
import pandas as pd
판다 색인 생성
index = pd.Index([10, 20, 70, 40, 90, 50, 25, 30])
팬더 인덱스 표시 -
print("Pandas Index...\n",index) 최대값 얻기 -
print("\nMaximum value..\n", index.max())
예시
다음은 코드입니다 -
import pandas as pd
# Creating Pandas index
index = pd.Index([10, 20, 70, 40, 90, 50, 25, 30])
# Display the Pandas index
print("Pandas Index...\n",index)
# Return the number of elements in the Index
print("\nNumber of elements in the index...\n",index.size)
# Return the dtype of the data
print("\nThe dtype object...\n",index.dtype)
# get the maximum value
print("\nMaximum value..\n", index.max()) 출력
이것은 다음과 같은 출력을 생성합니다 -
Pandas Index... Int64Index([10, 20, 70, 40, 90, 50, 25, 30], dtype='int64') Number of elements in the index... 8 The dtype object... int64 Maximum value.. 90