파이썬 Pandas 데이터 프레임은 각 그룹의 첫 번째 행을 가져옵니다.
다음과 같은 팬더 DataFrame 이 있습니다. df = pd.DataFrame({'id' : [1,1,1,2,2,3,3,3,3,4,4,5,6,6,6,7,7], 'value' : ["first","second","second","first", "second","first","third","fourth", "fifth","second","fifth","first", "first","second","third","fourth","fifth"]}) 나는 이것을 [ "id", "value"]로 그룹화하고 각 그룹의 첫 번째 행을 얻고 싶습니다. id value 0 1 first 1 1 second 2 1 second 3 2 first 4 2 second 5 3 first 6 3 third 7 3 fourth ..
2020. 12. 31.