Pandas 행과 열의 문자열인덱스를 숫자로 가져오는 방법
# pandas 문자열로 된 인덱스를 숫자로 가져오는방법 # Create a sample dataframe df = pd.DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6], 'C': [7, 8, 9]}, index=['a', 'b', 'c']) # Find the index number of label 'b' index_number = df.index.get_loc('b') print(index_number) # Output: 1 # pandas 문자열로 된 컬럼을 숫자로 가져오는방법 # Create a sample dataframe df = pd.DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6], 'C': [7, 8, 9]}) # Find the ind..
2022. 12. 16.