전체 글
-
3. 변수와 입력 사용하기Python/Grammar 2022. 11. 29. 12:56
# 1. 변수 만들기 파이썬에서는 변수를 만들기 위해 '=(assignment operator: 할당연산자)' 을 사용해 값에 변수를 할당하며, 변수 이름을 지정할 때는 다음과 같은 규칙을 따라야 한다. 💡 변수 naming 규칙 - 영문 문자와 숫자를 사용할 수 있다. - 대소문자를 구분한다. - 문자부터 시작해야 하며 숫자부터 시작하면 안 된다. - _(밑줄 문자)로 시작할 수 있다. - 특수 문자(+, -, *, /, $, @, &, % 등)는 사용할 수 없다. - 파이썬의 키워드(if, for, while, and, or 등)는 사용할 수 없다. 1-1. 변수의 자료형 알아내기 type(변수) >>> x = 100 >>> type(x) >>> y = 'Hello, Python!' >>> type(..
-
1. 기본 문법Python/Grammar 2022. 11. 28. 22:43
# 세미콜론 한 줄에 여러 구문을 사용할 때 세미콜론을 붙인다. 대부분의 프로그래밍 언어들은 구문이 끝날 때 세미콜론을 붙여야하지만 파이썬은 세미콜론을 붙이지 않아도 문법 에러가 발생하지 않는다. EX) print('Hello'); print('Python') # 공백 파이썬 코딩 스타일 가이드(PEP 8)에서는 공백 4칸으로 규정하고 있어 공백 4칸을 사용하는 것이 좋으나 공백 2칸, 탭 1칸을 사용해도 잘 동작한다. 단, 같은 블록은 들여쓰기 칸 수가 같아야 하고 공백과 탭 문자를 섞어쓰면 안 된다. # 코드 블록 파이썬은 들여쓰기를 기준으로 코드 블록을 구성한다. EX) count = 0 # 코드 블록 1 while count < 10: # 코드 블록 1 count += 1 # 코드 블록 2 pri..
-
2. 숫자 계산하기Python/Grammar 2022. 11. 28. 12:52
# 정수 계산하기 사칙연산하기: + - * / >>> 10 + 1 11 >>> 10 / 2 5.0 # 파이썬3은 몫으로 완전히 나누어떨어져도 5.0과 같이 실수가 나옴 버림 나눗셈 몫 구하기: // >>> 7 // 3 2 >>> 6 // 3 2 나눗셈 나머지 구하기: % >>> 3 % 1 0 거듭제곱 구하기: ** >>> 3 ** 3 27 값을 정수로 만들기 : integer(정수)를 의미하는 int를 사용한다. int(숫자) int(계산식) int(문자열) >>> int('500') 500 객체의 자료형 알아내기 type(값) >>> type(500) 몫과 나머지 함께 구하기 : divmod를 사용해 피제수를 제수로 나누면 튜플 형태로 몫과 나머지가 반환된다. divmod(피제수, 제수) -> (몫, ..
-
[MySQL] 스파르타 코딩클럽 "엑셀보다 쉬운 SQL" 3주차DataBase/RDBMS 2022. 9. 18. 04:32
이번주는 join을 배웠다-!join이란, 공통된 정보 (key값)를 기준으로 두 테이블을 연결해서 한 테이블처럼 보는 것이다.key는 두 테이블의 연결고리가 되므로 당연히 테이블 양쪽 모두에 존재해야 한다. 자주 사용하는 join 개념에는 inner join과 left join이 있다. 쉽게 생각하면 inner join은 교집합, left join은 합집합이다. left join은 join 순서에 따라 결과가 달라지므로 inner join보다 까다롭다. A테이블과 B테이블을 join(left join)할 때, A를 왼쪽에 두고 기준으로 삼으면 B에는 없는 정보가 발생할 수 있다.다시말해 A에 B가 붙을 때 A가 기준이기 때문에 A테이블은 온전히 보이지만 B테이블에는 NULL값이 발생할 수 있는 것이다...
-
[MySQL] 스파르타 코딩클럽 "엑셀보다 쉬운 SQL" 2주차DataBase/RDBMS 2022. 9. 4. 19:32
이번주는 SQL 쿼리를 이용해 보고싶은 raw data를 의미를 갖는 '정보'로 변환시키는 법을 익혔다. 그 방법은 바로 '통계'를 내고 '정렬'을 하는 것이다. 통계를 내기 위해서는 GROUP BY, 정렬을 하기 위해서는 ORDER BY를 사용한다. 1. GROUP BY: GROUP BY를 기반으로 '개수', '최대값', '최소값', '합계', '평균값'등을 구해 통계를 낼 수 있다. SELECT 필드명, method(*) FROM 테이블명 GROUP BY 필드명; : 특정 필드별로 통계치를 보겠다! 💡 쿼리가 실행되는 순서는 FROM → GROUP BY → SELECT라는 것을 기억! 💡 어떤 기준으로 통계를 냈는지 확인할 수 있도록 SELECT로 출력할 내용에 통계치를 낼 method를..
-
[MySQL] 스파르타 코딩클럽 "엑셀보다 쉬운 SQL" 1주차DataBase/RDBMS 2022. 8. 28. 20:14
업무할 때 SQL 쿼리를 자유롭게 구사하기 위해서 어떻게 공부할지 고민하다가 스파르타 코딩클럽의 SQL 수업을 신청하게 됐다.흥미가 붙은 파이썬은 책 한권 잡아서 혼자 공부하는데에 무리가 없지만 SQL은 약간의 강제성이 필요하다고 느꼈다. 그나저나 파이썬, 네트워크 관리사 2급 공부한 내용들도 정리해야하는데 역시 과제인 SQL을 먼저 하고있는 나...아 맞다.. 채팅프로그램 코드리뷰도 해야지!!!🙄 미루고 미루다 후회하지 말자 유진....😇 1주차는 아래와 같은 기본적인 내용이었다. 1) SHOW TABLES로 database에 어떤 테이블들이 있는지 파악2) 원하는 정보가 있을 것 같은 테이블에 대해서 "SELECT * FROM 테이블명" 쿼리 실행3) 원하는 정보를 찾을 때까지 2)를 반복4) 테..
-
I/O Multiplexing이 가능한 채팅 프로그램 - 개요Side Project 2022. 7. 5. 17:27
6월 15일에 6개월간의 빅데이터 분석 국비지원 교육을 마치고 어제인 7월 4일 엔진팀으로 입사했다. 비전공자이지만 취뽀했다는 사실만으로 정말 뿌듯하다. 사실 역량을 더 키우는 시간을 가지고 싶었지만 일하면서 부딪혀보는 것도 나쁘지 않다고 생각했다. 빅데이터 분석과정을 수료했지만 수업을 들으면서 엔지니어쪽으로 더 관심이 생겨서 서버 엔진 개발쪽으로 문을 두드렸다. 앞으로 수많은 어려움이 있겠지만 나를 믿고 차근차근 해결해나가보자! 이 블로그를 만든게 엊그제 같은데 벌써 6개월이 지나서 7월이 됐다. 교육받으면서 학습한 내용, 삽질한 내용들을 정리하려고 했는데 업로드한 포스팅이 1개밖에 없다. 정리가 덜 된 임시저장 파일들만 잔뜩이다. 😹 이젠 열심히 써야지 ㅎㅎ 꾸준히 정리해나가면 피가 되고 살이 ..
-
ELK Stack (Beats-Logstash-Elasticsearch-Kibana) 설치 및 구축 - 1. ELK Stack이란?DevOps/ELK 2022. 2. 7. 01:25
ELK Stack은 로깅(logging) 구현에 효과적인 툴이다. 로깅이란 시스템의 작동 정보인 로그(log)를 기록하는 행위로, 머신 데이터의 증가와 함께 그 중요성이 커지고 있다. 로깅은 시스템 문제를 진단하고 해결하여 애플리케이션의 성능을 최적화하고, 로깅을 통해 얻은 결과는 비즈니스의 주요 지표 및 데이터로 활용되기도 한다. ✔ 여기서 잠깐! 머신 데이터는 센서나 장비에서 발생하는 데이터를 의미한다. (cf. 휴먼 데이터: Email, SMS 등 의사소통 데이터, Facebook, Blog, Twitter 등 소셜미디어 데이터 등) 기존 보안 장비, 웹 서버, 생산 설비에서 발생하는 로그 데이터, 스마트폰, 텔레매틱스, 건물 등에 장착된 센서 데이터, 웨어러블기기에서 얻을 수 있는 IoT 데이터 ..