분류 전체보기
-
pytube.exceptions.RegexMatchError Issue카테고리 없음 2022. 1. 23. 11:56
유투브에서 영상이나 음악을 받을 수 있는 Python 패키지중 오픈소스인 pytube가 있다. 손쉽게 Video 또는 Playlist를 다운받을 수 있는데, 최근, 아래와 같은 에러가 발생해서 구글링을 통해 이슈를 해결했다. > python3 Python 3.8.8 (default, Apr 13 2021, 12:59:45) [Clang 10.0.0 ] :: Anaconda, Inc. on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from pytube import YouTube >>> yt = YouTube('https://www.youtube.com/watch?v=GzQ1FebwQHI') >>> yt..
-
Relational DatabasesComputer Science/Basic Programming with Python 2021. 12. 7. 21:37
SQL Relational Databases은 데이터를 row, column형태의 tables에 저장하는 형태이다. 여러개의 테이블이 있고, 그 테이블간 연결성이 존재할 때, 강점을 나타낸다. 그 테이블에서 데이타를 이용할 수 있게끔 만들어진 언어들중, 가장 많이 쓰는것이 바로 SQL이다. SQL은, Structured Query Language,로 테이블 또는 데이터를 만들고(Create), data를 꺼내어 쓰고(Retrieve), 데이터를 변형하고(Update) 데이터를 지울 수(Delete) 있도록 해준다. 이것을 CRUD라고 한다. Roles 보통 큰 프로젝트를 보면 역활이 2개 이상으로 나누어진다. 프로젝트가 커져서 데이터 분석의 니즈가 커지면, Data 전문가가 필요해지지만 프로젝트 생성에는..
-
Object OrientedComputer Science/Basic Programming with Python 2021. 12. 7. 21:06
Python 코딩을 하다보면 Object Oriented Programing이라는 terminology를 사용하게 된다. 예를들면, BeautifulSoup은 soup이라는 object를 리턴한다. 그리고, 그 soup object 안에 있는 method를 사용하면 list를 리턴하는등의 동작을 하는것이다. 줄여서 OOP라고도 부른다. 예를 들어보자. list objects들을 나열한 리스트이다. 리스트 데이터 타입에 어떤 methods들이 있는지를 보여준다. 이렇게 functions(또는 methods)들은 objects 들에 속해있다. 또다른 예시를 보자. MySQL같은 DB를 연결하기 위해서는 connection object가 필요하다. sqlite3과 같은 object를 import해서, db와 ..
-
Number of Students Unable to Eat LunchAlgorithm/Queue and Stack 2021. 11. 22. 23:59
The school cafeteria offers circular and square sandwiches at lunch break, referred to by numbers 0 and 1 respectively. All students stand in a queue. Each student either prefers square or circular sandwiches. The number of sandwiches in the cafeteria is equal to the number of students. The sandwiches are placed in a stack. At each step: If the student at the front of the queue prefers the sandw..
-
Number of Recent CallsAlgorithm/Queue and Stack 2021. 11. 22. 23:01
You have a RecentCounter class which counts the number of recent requests within a certain time frame. Implement the RecentCounter class: RecentCounter() Initializes the counter with zero recent requests. int ping(int t) Adds a new request at time t, where t represents some time in milliseconds, and returns the number of requests that has happened in the past 3000 milliseconds (including the new..
-
First Unique Character in a StringAlgorithm/String 2021. 11. 22. 22:40
Given a string s, find the first non-repeating character in it and return its index. If it does not exist, return -1. Example 1: Input: s = "leetcode" Output: 0 Example 2: Input: s = "loveleetcode" Output: 2 Example 3: Input: s = "aabb" Output: -1 Constraints: 1
-
Implement Queue using StacksAlgorithm/Queue and Stack 2021. 11. 22. 22:08
Implement a first in first out (FIFO) queue using only two stacks. The implemented queue should support all the functions of a normal queue (push, peek, pop, and empty). Implement the MyQueue class: void push(int x) Pushes element x to the back of the queue. int pop() Removes the element from the front of the queue and returns it. int peek() Returns the element at the front of the queue. boolean..