비트마스킹 : Bit Masking 관련 Python 함수 비트마스킹에 대한 개념 설명은 생략 Bin(숫자) 10진수(int)를 2진수(str)로 바꿔준 num=6 # 110 print(bin(num)) print(type(bin(num))) 그래서 bin(num)[2:] 이렇게 앞의 '0b'를 없애줄 수 있다. 또한 이진수의 1을 셀 때 string이기 때문에 bin(num).count('1')을 사용할 수 있어 굉장히 편하다 int(x, n진수) num=6 # 110 x=bin(num) binary_to_demical = int(x, 2) print(binary_to_demical) 2진수였던 수를 다시 10진수로 바꾸려면 int로 바꿀 수 있다 연속형 변수를 binning(구간을 나누어 그룹)하여 범주형으로 변형 : Binning Records on a Continuous Variable with Pandas Cut and QCut 번역 https://towardsdatascience.com/binning-records-on-a-continuous-variable-with-pandas-cut-and-qcut-5d7c8e11d7b0 Binning Records on a Continuous Variable with Pandas Cut and QCut When, why, and how to transform a numeric feature into a categorical feature towardsdatascience.com 해당 글을 참고, 번역한 글입니다. 연속형 변수를 binning(구간을 나누어 그룹지음)하는 것에 대해서 생각해보자 Binning할 때 주의할 점 granularity(얼마나 자세히 분할되어 있는지)가 줄어든다. 당연히.. 이전 1 다음