본문 바로가기

분류 전체보기64

1. Two Sum (Leet Code) Python 풀이 1. Two Sum Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have exactly one solution, and you may not use the same element twice. You can return the answer in any order. Example 1 Input: nums = [2,7,11,15], target = 9 Output: [0,1] Explanation: Because nums[0] + nums[1] == 9, we return .. 2023. 1. 24.
데이터 엔지니어(아홉번째 이야기) 절차 vs OOP Python의 type() 을 호출하여 클래스 확인 가능 클래스는 상태와 행동에 대한 정보를 포함 # Print the mystery employee's name print(mystery.name) # Print the mystery employee's salary print(mystery.salary) # Give the mystery employee a raise of $2500 mystery.give_raise(2500) # Print the salary again print(mystery.salary) 실습 # Include a set_name method class Employee: def set_name(self, new_name): self.name = new_name # .. 2021. 10. 28.
데이터 엔지니어(여덟번째 이야기) cat 명령어와 grep 명령어를 통해 특정년도의 수상자를 검색 입력 cat soccer_scores.csv | grep "1959" 출력 1959,Dunav,2 cat, grep or 명령, wc 명령을 통한 갯수 출력 입력 cat two_cities.txt | grep -e "Sydney Carton" -e "Charles Darnay" | wc -l 출력 77 Bash script anatomy 기본적으로 /usr/bash if you installed bash in basic directory, bash usually located in /usr/bash #!/usr/bash 어원 유닉스 계열에서는 sharp(#) + bang(!) 합성어로 sha-bang 이라 함 확장자 명 file extens.. 2021. 10. 14.
데이터 엔지니어(일곱번째 이야기) 추후 업데이트 예정 2021. 10. 14.