티스토리

ILOCNEAM
검색하기

블로그 홈

ILOCNEAM

maencoli.tistory.com/m

이것저것 아카이빙

구독자
0
방명록 방문하기

주요 글 목록

  • [패스트캠퍼스] SQL 강의 2주차 (Day6); GROUP BY, HAVING, COUNT, SUM, AVG, MINMAX 데이터 그룹화하기 GROUP BY GROUP BY[칼럼이름] 주로 그룹 별 데이터를 집계할 때 사용, 엑셀 피벗 기능과 유사함 GROUP BY가 쓰인 쿼리의 SELECT절에는 GROUP BY대상 칼럼과 그룹 함수만 사용 가능 GROUP BY대상 컬럼이 아닌 칼럼을 SELECT하면, 에러가 발생 여러 칼럼으로 그룹화 가능함, 키워드 뒤에 [컬럼이름]을 복수 개 입력 칼럼 번호로 그룹화 가능함 칼럼 번호는 SELECT 절의 칼럼 이름 순서를 의미함 SELECT [GROUP BY 대상칼럼이름], ..., [그룹함수] FROM [테이블 이름] WHERE 조건식 GROUP BY [칼럼 이름]; 그룹에 조건 주기 HAVING 가져올 데이터 그룹에 조건 지정 HAVING 조건식 조건식이 True 가 되는 그룹만 선택.. 공감수 0 댓글수 0 2023. 3. 7.
  • [패스트캠퍼스] SQL 강의 1주차 (Day5); ORDER BY, RANK, ROW_NUMBER 데이터 줄세우기 ORDER BY 가져온 데이터를 정렬 ORDER BY [컬럼이름] 입력한 [컬럼이름]의 값을 기준으로 모든 ROW를 정렬 기본 정렬 규칙은 오름차순 ORDER BY[컬럼 이름] = ORDER BY [컬럼 이름] ASC 내림차순을 원할 경우, 마지막에 DESC 키워드 추가 (ORDER BY [컬럼 이름] DESC) 여러 컬럼으로 정렬 가능하며, 키워드 뒤에 [컬럼이름]을 복수 개 입력하면 됨 위치한 순서대로 정렬됨 컬럼 번호로도 정렬 가능함 컬럼 번호는 SELECT절의 컬럼 이름 순서! SELECT [컬럼 이름] FROM [테이블 이름] WHERE 조건식 ORDER BY [컬럼 이름] ASC; # ASC는 생략 가능함 #내림차순 하고 싶은 경우 SELECT [컬럼 이름] FROM [테이블 .. 공감수 0 댓글수 0 2023. 3. 7.
  • [패스트캠퍼스] SQL 강의 1주차 (Day4); WHERE, NOT, AND, OR, BETWEEN, IN, LIKE, IS NULL, SELECT [컬럼이름] FROM [테이블 이름] WHERE [컬럼 이름] BETWEEN [조건1] AND [조건2]; 조건에 맞는 데이터 가져오기 WHERE 가져올 데이터의 조건 지정 WHERE 조건식 조건이 True가 되는 row 만 선택 SELECT [컬럼이름] FROM [테이블 이름] WHERE 조건식; 보통은 '연산자'를 사용해서 조건식 작성 원하는 데이터 조건이 True가 되게끔 조건식 작성 True 값은 1, False 값은 0으로 표현 종류 : 비교 연산자/ 논리 연산자/ 기타 주요 연산자 비교 연산자 (=,) 연산자 활용 의미 = A = B A 와 B가 같다 != A != B A와 B가 같지 않다 > A > B A가 B보다 크다 >= A >= B A가 B보다 크거나 같다 공감수 0 댓글수 0 2023. 3. 7.
  • [패스트캠퍼스] SQL 강의 1주차 (Day3); SELECT, FROM, ALIAS, LIMIT, DISTINCT 데이터 가져오기 SELECT 가져올 데이터를 선택 값을 가져올 컬럼 선택 SELECT 123; # 123 SELECT 1 + 2 + 3; # 6 SELECT "ABC"; #ABC 테이블에서 데이터 가져오기 FROM 데이터를 가져올 테이블을 지정하는 키워드; 모든 쿼리에 필수임! FROM [테이블 이름] 테이블이 어떤 데이터베이스 안에 있는지 데이터베이스 이름도 같이 명시 USE 키워드 통해 사용할 데이터베이스를 지정해주었다면 생략 가능함 [활용] 숫자, 문자, 데이터 가져오기 SELECT 데이터 형식으로 사용 칼럼을 선택해 칼럼 값을 가져옴 SELECT [칼럼 이름]형식으로 사용 *를 통해 전체를 가져옴 SELECT * 형식으로 사용 *은 칼럼 전체 (ALL)를 의미함 #칼럼 하나만 선택 SELECT [.. 공감수 0 댓글수 0 2023. 3. 4.
  • [패스트캠퍼스] SQL 강의 1주차 (Day2) ## 데이터 타입 정보의 종류에 따라 분류함 - MySQL 에서 사용 가능한 데이터 타입 : 숫자형 (정수형, 실수형), 문자형, 날짜형 *** MySQL 에서는 데이터 저장 전, 저장 공간을 미리 정해둠. 미리 정해둔 데이터 타입이 아닐 경우, 데이터 저장이 불가함. 숫자형 데이터 - 정수형 : 바이트 수에 따라 표현/저장 가능한 숫자 범위가 달라짐, 주로 데이터 타입은 INT (약 -21억 -- +21억) - 실수형 : float type 가장 많이 문자형 데이터 ** 괄호 안에 얼만큼의 저장공간을 사용할지 미리 입력을 해야함 - CHAR(n) : n 은 1-255까지 지정 가능, 지정 안할 시 1자동 입력. 고정길이로 문자열 저장 - VARCHAR(n) : n은 1-65535, 지정 안할 시 사용 .. 공감수 0 댓글수 0 2023. 3. 1.
  • Friedman, Wilcoxon (post-hoc) R Friedman test 계속 오류가 떴는데, 알고보니 group 과 ID를 factor 화 시키지 않아서였다. data$ID = as.factor(data$ID) data$soundType = as.factor(data$soundType) res.fried = friedman.test(satisfaction ~ soundType | ID, data = data) res.fried Wilcoxon (post-hoc) 위는 wilcox_test, 아래는 effect size 구하기 위한 코드. Z score 와 r-stat계산한 것을 report 해주어야한다. wilcox_test( data, formula, comparisons = NULL, ref.group = NULL, p.adjust.method .. 공감수 0 댓글수 0 2022. 6. 16.
  • 추계학 이것저것,,, 정리해야되는데 지금은 시간 이 없어서 필요한 개념들 위키 모아놓기,,, https://en.wikipedia.org/wiki/Negative_binomial_distribution negative binomial models the number of successes in a sequence of independent and identically distributed Bernoulli trials before a specified (non-random) number of failures (denoted r) occurs. IID로 분포되어있는 bernoulli 시행에서 n번째 failure 전에 일어나는 success 수에 대한 모델! Negative binomial distribution - Wikipedia This article or section appears to .. 공감수 0 댓글수 0 2022. 4. 25.
  • [Stochastics] 추계학 이것저것,,, 정리해야되는데 지금은 시간 이 없어서 필요한 개념들 위키 모아놓기,,, https://en.wikipedia.org/wiki/Negative_binomial_distribution negative binomial models the number of successes in a sequence of independent and identically distributed Bernoulli trials before a specified (non-random) number of failures (denoted r) occurs. IID로 분포되어있는 bernoulli 시행에서 n번째 failure 전에 일어나는 success 수에 대한 모델! Negative binomial distribution - Wikipedia This article or section appears to .. 공감수 0 댓글수 0 2022. 4. 22.
  • [Stochastics] conditional expectation E[X]에 y 를 개입하여 생각했을 때, E[X] = E[X|XY) 여기서 막혔던 부분! 출처: https://math.stackexchange.com/questions/2169833/conditional-expectation-of-x-given-x-is-greater-than-y 혹시나 나중에 글 지워지거나 못 찾을까봐 아래 캡쳐본.... 추가로 : https://en.wikipedia.org/wiki/Conditional_probability_distribution Conditional probability distribution - Wikipedia In probability theory and statistics, given two jointly distributed random variables.. 공감수 0 댓글수 0 2022. 3. 16.
  • 3.3. Multi-dimensional arrays 3.3.1. The MultiArray abstract data type A multi-dimensional array consists of a collection of elements organized into multiple dimensions. Individual elements are referenced by specifying an n-tuple or a subscript of multiple components, one for each dimension of the array. All indices of the n-tuple start at zero. MultiArray(d1, d2, ...dn) # creates a multi-dimensional array of elements organi.. 공감수 0 댓글수 0 2022. 3. 13.
  • 3.2. Maps Data structures and algorithm > ch.3 sets and maps > 3.2. maps A map is a container for storing a collection of data records in which each record is associated with a unique key. The key components must be comparable Map() # Creates a new empty map length() # returns the number of key/vlaue pairs in the map contains(key) # determines if the given key is in the map and returns True if the key is .. 공감수 0 댓글수 0 2022. 3. 13.
  • 3.1. Set Data structures and algorithm > ch.3 sets and maps > 3.1. set set() # create a new set initialized to the empty set len() # returns the number of elements in the set, also known as the cardinlity contains(element) # determines if the given value is an element of the set if the element is not already a memeber # if the element is not unique, no action is taken and the operation is skipped remove(.. 공감수 0 댓글수 0 2022. 3. 13.
  • Searching problem (linear, binary) 1. linear search 리스트 처음부터 끝까지 하나씩 비교해가며 찾는 방법 Time complexity 는 O(N) def LinearSearch(list, value): for i in range (len(list)): if list[i] == value: return i return -1 2. Binary search (리스트가 정렬 되어있다는 전제에서 search) 리스트 중간 value 와 비교하여 리스트의 절반에서 탐색하는 방법 Time complexity 는 O(log N) def BinarySearch(list, value): first = 0 last = len(list) - 1 while first 공감수 0 댓글수 0 2022. 3. 10.
  • 공부한거 정리하기! 더보기 공부했는데 시간이 지나면 휘발되어버려서 또 검색할 미래의 나를 위해... (물론 이래놓고 블로그에 옮기지 않을 수도 있지만 ㅠ) 이번에는 제발 꾸준히 옮겨봅시다. 책은, All of statistics by Wasserman, Praobability and statistics for computer scientists by Michael Baron, ... 공감수 0 댓글수 0 2022. 3. 4.
  • [백준 단계별로 풀어보기] python3 문자열 11654번 아스키 코드 inputletter = input() print(ord(inputletter)) 11720번 숫자의 합 length = int(input()) numbers = input() ans = 0 for i in range (length): ans += int(numbers[i]) print(ans) 10809 알파벳 찾기 S = input() alphabet = {'a': -1, 'b': -1, 'c': -1, 'd': -1, 'e': -1, 'f': -1, 'g': -1, 'h': -1, 'i': -1, 'j': -1, 'k': -1, 'l': -1, 'm': -1, 'n': -1, 'o': -1, 'p': -1, 'q': -1, 'r': -1, 'x': -1, 't': -1, '.. 공감수 0 댓글수 0 2022. 1. 4.
  • [백준 단계별로 풀어보기] python3 함수 15596번 정수 N개의 합 def solve(a): ans = 0 for i in a: ans += i return ans 4673번 셀프넘버 def sumDigit(n): ans = 0 while n > 9: ans += n%10 n = n//10 return ans + n def ifSelf(n): i = 0 while i < n: if sumDigit(i) + i == n: return i += 1 print(i) i = 1 while i < 10000: ifSelf(i) i += 1 이렇게 했더니 시간초과가 떴다...ㅠ 수정해야지... 1065번 한수 count = 0 naturalN = input() i = 1 while i 공감수 0 댓글수 0 2021. 12. 29.
  • [MIT open course] 6.006 Introduction to Algorithms Spring 2020 https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-006-introduction-to-algorithms-spring-2020/index.htm Introduction to Algorithms This course is an introduction to mathematical modeling of computational problems, as well as common algorithms, algorithmic paradigms, and data structures used to solve these problems. It emphasizes the relationship between algorithms and prog.. 공감수 0 댓글수 0 2021. 12. 27.
  • [백준 단계별로 풀어보기] python3 1차원 배열 10818 최소, 최대 최솟값과 최댓값을 찾는 문제 num = int(input()) num_list = list(map(int, input().split())) min_list = num_list[0] max_list = num_list[0] i = 0 while i in range(num): if num_list[i] max_list: max_list = num_list[i] i += 1 print(min_list, max_list) 2562 최댓값 최댓값이 어디에 있는지 찾는 문제 num_list = [] for i in range(9): num_list.append(int(input())) print(ma.. 공감수 0 댓글수 0 2021. 12. 27.
    문의안내
    • 티스토리
    • 로그인
    • 고객센터

    티스토리는 카카오에서 사랑을 담아 만듭니다.

    © Kakao Corp.