value_counts어떤 값들이 있는지 대략적으로 보기. 종류와 개수를 새어준다. stud_alcoh1['Pstatus'].value_counts() s.str.contains(' string ')series 데이터에 .str 을 붙여 text data 를 변형할 수 있다. stud_alcoh1.famsize.str.contains('G') isin포함 한다면 True, 포함하지 않는다면 False mother_job = stud_alcoh1.loc[stud_alcoh1.Mjob.isin(['at_home', 'services']), ['Mjob','Fjob', 'reason']] df.aggnumpy.ptp 편차 구하기 chipo.groupby('order_id')['item_price'].agg(n..
출처 : https://www.hackerrank.com/challenges/30-binary-numbers/problem 문제Given a base- integer, , convert it to binary (base-). Then find and print the base- integer denoting the maximum number of consecutive 's in 's binary representation.입력받은 Integer 를 Binary 로 표현했을때, 연속적으로 1이 최대 몇번이 들어갔는지 계산하여 반환하기 ExampleInput : 5 Output : 1 (5를 바이너리 변환 시 101, 1이 연속 1번) Input : 13Output : 2 (13을 바이너리 변환 시 1101..
문자열 입력 키보드로 문자열을 입력하는 System.in 을 받아서 처리해주는 Scanner 클래스를 생성한다. Scanner의 nextLine() 메소드는 Scan 한 소스의 다음 문자열 라인을 읽어온다. Scanner scan = new Scanner (System.in); message = scan.nextLine(); Integer 을 받아올때는 nextInt()함수를 사용한다Scanner in = new Scanner(System.in); int n = in.nextInt(); 그 외 double 형을 받아오는 nextDouble 함수도 있다. 만약 아래의 인풋을 받아와야 할 때, (n개의 스트링을 받아와야하고, n이 입력된 후 n개의 string 이 입력)2string1string2 in.ne..