일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Python Implementation
- Decorator
- DWG
- LeetCode
- Convert Sorted List to Binary Search Tree
- 43. Multiply Strings
- attribute
- Generator
- 밴픽
- Regular Expression
- 컴퓨터의 구조
- 운영체제
- 315. Count of Smaller Numbers After Self
- shiba
- concurrency
- 시바견
- Python Code
- Class
- 30. Substring with Concatenation of All Words
- 파이썬
- data science
- 109. Convert Sorted List to Binary Search Tree
- 프로그래머스
- iterator
- t1
- Protocol
- Substring with Concatenation of All Words
- kaggle
- Python
- 715. Range Module
- Today
- Total
목록전체 글 (382)
Scribbling
Python does not provide standard library for ordered set or ordered dictionary. However, there's an Apache2 licensed sorted collections library "SortedContainer". You can install the library with the following cmd. pip install sortedcontainers https://www.geeksforgeeks.org/python-sorted-containers-an-introduction/#:~:text=Sorted%20set%20is%20a%20sorted,must%20be%20hashable%20and%20comparable. Py..
I found this problem is pretty similar to 'Russian Doll' prob (https://leetcode.com/problems/russian-doll-envelopes/). Thought process for this problem is: 0> Sort the properties. 1> Let's just assume that attack strictly increases (e.g. 3, 4, 5, ...): then what we should do is to count how many defense values have larger values on their right side. And that's exactly what monotonicly desc stack..
In this post, I will review basics of Spark, especially pySpark. Spark is a framework for handling big data and has a great strength in distributed system with multiple nodes. To install pyspark, simply 'pip install pyspark'. For demonstration, I will use 'heart.csv' dataset from https://www.kaggle.com/datasets/johnsmith88/heart-disease-dataset. Now, let's get down to the code. In pyspark, we ca..
From installation to basic concepts, I recommend the video below. https://www.youtube.com/watch?v=hWPv9LMlme8 Below is an official tutorial for docker beginners. This post is a short step-by-step review of it. https://docker-curriculum.com/#our-first-image A Docker Tutorial for Beginners Learn to build and deploy your distributed applications easily to the cloud with Docker docker-curriculum.com..
1. Pandas Series 1.1. Series import pandas as pd a = [1, 7, 2] myvar = pd.Series(a) print(myvar) 1.2. with index a = [1, 7, 2] myvar = pd.Series(a, index = ["x", "y", "z"]) print(myvar) 1.3. set of (keys, values) calories = {"day1": 420, "day2": 380, "day3": 390} myvar = pd.Series(calories) print(myvar) calories = {"day1": 420, "day2": 380, "day3": 390} myvar = pd.Series(calories, index = ["day1..
0. JavaScript Environment https://jsbin.com/?js,console JS Bin Sample of the bin: jsbin.com 1. Variables let x = 3; const y = 4; console.log(x*y); let num = 3.14; console.log(typeof(x)) 2. Conditionals 2.1. If let season = 'summer'; if (season === 'spring') { console.log('It\'s spring! The trees are budding!'); } else if (season === 'winter'){ console.log('It\'s winter! Everything is covered in ..
Question: There is a stream of two different operations. One is placing a point on a single axis. The other is to check if there's a point in a given range. (see the image below) 1> Brute Force 1-1> For every range check, we can just go over all the points it includes. Time complexity for that would be O(R * N), where R is range and N is the number of range checks. 1-2> Or, we can just go over a..
Monotonic stack or monotonicly increasing/decreasing stack is a stack which keeps its elements in increasing/decreasing order. Monotonic stacks are useful when, - Finding the very previous less element of each element in a vector in O(N) time complexity - Finding the very next less element of each element in a vector in O(N) time complexity (1) Code Example To get the very previous less (or equa..
클래스 메타프로그래밍은 실행 도중에 클래스를 생성하거나 커스터마이징 하는 기술이다. 클래스 데코레이터와 메타클래스는 이를 위한 방법이다. 메타클래스는 강력하지만, 어렵다. 클래스 데커레이터는 사용하기 쉽지만, 상속 계층 구조가 있는 경우에는 사용하기 어렵다. 1. 런타임에 클래스 생성하기 파이썬 표준 라이브러리에는 collections.namedtuple 이라는 클래스 팩토리가 있다. 클래스명과 속성명을 전달하면 이름 및 점 표기법으로 항목을 가져올 수 있다. 유사한 클래스 팩토리를 만들면서 런타임에 클래스 생성하는 방법을 확인해보자. def record(cls_name, field_names): try: field_names = field_names.replace(',', '').split() exce..
디스크립터를 이요하면 여러 속성에 대한 동일한 접근 논리를 재사용 가능하다. 디스크립터는 __get__(), __set__(), __delete__() 메서드로 구성된 프로토콜을 구현하는 클래스다. property 클래스는 디스크립터 프로토콜을 완벽히 구현한다. 아래 글에서 동적 속성을 구현함에 있어 프로퍼티 팩토리를 이용했었다. https://focalpoint.tistory.com/314 Python: Dynamic attributes and properties (동적 속성과 프로퍼티) 파이썬에서는 데이터 속성과 메서드를 통틀어 속성이라고 한다. 메서드는 단지 호출가능한 속성이다. 프로퍼티를 사용하면 클래스인터페이스를 변경하지 않고도 공개 데이터 속성을 접근자 메 focalpoint.tistory.c..