
파이썬 특징 인터프리터 언어 객체지향적 동적 타이핑 (실행 시 자료 검사) C와 같은 언어랑 비교해서 속도가 다소 느리다. (하지만, 일반인은 큰차이를 느끼기 어렵다..) ; 대신에 들여쓰기(tab)으로 구분한다 파이썬의 철학 The Zen of Python으로 PEP20 에서 찾아볼수 있다. 시간이 나면 한번씩 읽어보는 것도 나쁘지 않습니다. import this ''' Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense...

List only def is_palindrom(s: str) -> bool: strs = [] # Using deque for char in s: if char.isalnum(): strs.append(char.lower()) while len(strs) > 1: if strs.pop(0) != strs.pop(): return False return True Using deque from collections import deque def is_palindrom(s: str) -> bool: strs = deque([]) for char in s: if char.isalnum(): strs.append(char.lower()) while len(strs) > 1: if strs.popleft() !=..

1. Github에서 가져오기 url = '' df = pd.read_csv(url) 2. 로컬 드라이브 from google.colab import files uploaded = files.upload() import io df = pd.read_csv(io.BytesIO(uploaded['CSV FILE'])) 3. 드라이브 마운트 from google.colab import drive drive.mount('/content/drive') # 새로운 창에서 key 를 받아서 입력해야합니다. df = 'path to your csv' 작성 일인 7/23(목) 현재 코랩에서 드라이브 연결에 문제가 있어서... 다른 방법을 알아보던 중에 정리합니다.

Question Given a n x n matrix where each of the rows and columns are sorted in ascending order, find the kth smallest element in the matrix. Note that it is the kth smallest element in the sorted order, not the kth distinct element. Example matrix = [ [ 1, 5, 9], [10, 11, 13], [12, 13, 15] ], k = 8, return 13. 처음 생각한 간단한 방식은 matrix를 flatten 한 뒤 그 리스트의 k-1번째 인덱스를 리턴하면 될 듯하여 만든 코드입니다. class Soluti..

Medium 에서 글을 보다가 전부터 보던 streamlit 관련된 글이 있어서 다시 사용해본 후 쓰는 글입니다. streamlit 공식 페이지 예전에 한번 쓰려 했으나, 당시에는 버그 등이 너무 많아서 아쉬웠지만 이제는 안정화가 되었길 빌며 설치를 진행했습니다. 설치 pip install streamlit 기본 실행 streamlit hello Mapping, Animation, Plotting, Dataframe 등 다양한 데모를 확인 가능합니다. 원하는 파일 실행 시 streamlit run Example pip install opencv-python streamlit run https://raw.githubusercontent.com/streamlit/demo-self-driving/master/..

Reverse Linked list # Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = val # self.next = next class Solution: def reverseList(self, head: ListNode) -> ListNode: prev = None curr = head while curr: nex = curr.next curr.next = prev prev = curr curr = nex return prev Linked List Palindrome # Definition for singly-linked list. # class ListNode..

Question Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order. Solution class Solution: def searchInsert(self, nums: List[int], target: int) -> int: return 1일1깡 방법 if target in nums: return nums.index(target) else: nums.append(target) nums.sort() return nums.index(target) Binary Search low = 0 hi..

Description Given two binary strings, return their sum (also a binary string). The input strings are both non-empty and contains only characters 1 or 0. Answer class Solution: def addBinary(self, a: str, b: str) -> str: i = int(a,2) j = int(b,2) # ans = i+j # return bin(ans)[2:] return format(i+j,'b') 진수 변환 >> bin(30) '0b1110' >> oct(30) '0o36' >> hex(30) '0x1e' Format 함수 # 접두어 제외하기 >> format(0b..
- Total
- Today
- Yesterday
- 한빛미디어
- kubens
- go
- error
- lllm
- leetcode
- Gemma
- Fine-Tuning
- feed-forward
- csv
- 키보드
- palindrome
- 파이썬
- book
- 나는리뷰어다
- Container
- K8S
- LLM
- Binary
- BASIC
- collator
- Python
- AWS
- 책리뷰
- docker
- kubernetes context
- Kubernetes
- Git
- Shell
- Algorithm
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |