일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- numpy
- 배열쪼개기
- 배열나누기
- SQL
- concat
- Revising the Select Query I
- 배열붙이기
- 파이썬
- Python
- npy
- 벡터연산
- CONCATENATE
- 배열연산
- reshape
- 해커랭크
- 넘파이장점
- 배열추가
- SQL문제
- 배열자르기
- 배열형태변경
- 논리배열
- 파일저장하기
- 표본추출
- 랜덤샘플링
- 넘파이
- 배열분리하기
- buit-in exception
- ndarray
- Revising the Select Query II
- fancyindexing
- Today
- Total
목록전체 글 (21)
기록하는 습관
Problem HackerRank > Prepare > SQL > Basic Select > Weather Observation Station 1 Query a list of CITY and STATE from the STATION table. The STATION table is described as follows: where LAT_N is the northern latitude and LONG_W is the western longitude. Solution 더보기 SELECT DISTINCT CITY, STATE FROM STATION ;
Problem HackerRank > Prepare > SQL > Basic Select > Japanese Cities' Names Query the names of all the Japanese cities in the CITY table. The COUNTRYCODE for Japan is JPN. The CITY table is described as follows: Solution 더보기 SELECT NAME FROM CITY WHERE 1=1 and COUNTRYCODE = 'JPN' ;
Problem HackerRank > Prepare > SQL > Basic Select > Japanese Cities' Attributes Query all attributes of every Japanese city in the CITY table. The COUNTRYCODE for Japan is JPN. The CITY table is described as follows: Solution 더보기 SELECT * FROM CITY WHERE 1=1 and COUNTRYCODE = 'JPN' ;
try ~ except for i in [2,0,'-2'] : try : print(4/i) except : print('Error') 2.0 Error Error try ~ except ~ as 에러 구문을 확인하고 싶을 떄 for i in [2,0,'-2'] : try : print(4/i) except Exception as e: print(e) 2.0 division by zero unsupported operand type(s) for /: 'int' and 'str' try ~ except ~ else 에러가 나지 않았을 때 else 구문을 실행 List = [2,0,'-2','A'] for i in range(5) : print(f"_____{i} START_____") try : resul..
Problem HackerRank > Prepare > SQL > Basic Select > Select By ID Query all columns for a city in CITY with the ID 1661. The CITY table is described as follows: Solution 더보기 SELECT * FROM CITY WHERE 1=1 and ID = 1661 ;
Problem HackerRank > Prepare > SQL > Basic Select > Select All Query all columns (attributes) for every row in the CITY table. The CITY table is described as follows: Solution 더보기 SELECT * FROM CITY ;
Problem HackerRank > Prepare > SQL > Basic Select > Revising the Select Query II Query the NAME field for all American cities in the CITY table with populations larger than 120000. The CountryCode for America is USA. The CITY table is described as follows: Solution 더보기 SELECT NAME FROM CITY WHERE 1=1 and COUNTRYCODE = 'USA' and POPULATION > 120000
Problem HackerRank > Prepare > SQL > Basic Select > Revising the Select Query I Query all columns for all American cities in the CITY table with populations larger than 100000. The CountryCode for America is USA. The CITY table is described as follows: Solution 더보기 SELECT * FROM CITY WHERE 1=1 and COUNTRYCODE = 'USA' and POPULATION > 100000 ;
Numpy Data i/o import numpy as np txt 파일 저장 np.savetxt(파일명, 배열, fmt=문자열형식, delimiter=구분자) 아래 예시 배열을 저장해보자. array_save = np.arange(20).reshape(4,5) print( array_save ) [[ 0 1 2 3 4] [ 5 6 7 8 9] [10 11 12 13 14] [15 16 17 18 19]] fmt 값을 '%d'(정수)로 주지 않으면 실수 값으로 저장이 된다. np.savetxt("./sample_tab.txt", array_save, fmt='%d', delimiter="\t") 아래와 같이 잘 저장됨을 확인하였다. txt 파일 로드 np.loadtxt(파일명, dtype=데이터타입, d..
샘플링 함수들 import numpy as np np.random.uniform(하한, 상한, 형태) Docstring: uniform(low=0.0, high=1.0, size=None) Draw samples from a uniform distribution. Samples are uniformly distributed over the half-open interval [low, high) (includes low, but excludes high). In other words, any value within the given interval is equally likely to be drawn by uniform. print( np.random.uniform(0, 1, 5) ) print( np.r..