일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 더현대서울 맛집
- 프로그래머스 파이썬
- hackerrank
- github
- Real or Not? NLP with Disaster Tweets
- 프로그래머스
- 파이썬
- leetcode
- 캐치카페
- 편스토랑 우승상품
- SW Expert Academy
- 데이콘
- 코로나19
- gs25
- ubuntu
- 편스토랑
- 우분투
- 백준
- Git
- Docker
- AI 경진대회
- dacon
- 자연어처리
- programmers
- Kaggle
- ChatGPT
- Baekjoon
- 금융문자분석경진대회
- 맥북
- Today
- Total
목록
반응형
전체 글 (1651)
솜씨좋은장씨
Given a string S and a character C, return an array of integers representing the shortest distance from the character C in the string. Example 1: Input: S = "loveleetcode", C = 'e' Output: [3, 2, 1, 0, 1, 0, 0, 1, 2, 2, 1, 0] Note: S string length is in [1, 10000]. C is a single character, and guaranteed to be in string S. All letters in S and C are lowercase. 첫번째 시도 class Solution: def shortest..
with tf.Session() as sess: # Initialize TensorFlow variables sess.run(tf.global_variables_initializer()) sess.run(tf.global_variables_initializer()) for step in range(10001): cost_val, _ = sess.run([cost, train], feed_dict={X: x_data, Y: y_data}) if step % 200 == 0: print(step, cost_val) # Accuracy report h, c, a = sess.run([hypothesis, predicted, accuracy], feed_dict={X: x_data, Y: y_data}) pri..
Given an integer array arr, return the mean of the remaining integers after removing the smallest 5% and the largest 5% of the elements. Answers within 10-5 of the actual answer will be considered accepted. Example 1: Input: arr = [1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3] Output: 2.00000 Explanation: After erasing the minimum and the maximum values of this array, all elements are equal to 2, so ..
Given head which is a reference node to a singly-linked list. The value of each node in the linked list is either 0 or 1. The linked list holds the binary representation of a number. Return the decimal value of the number in the linked list. Example 1: Input: head = [1,0,1] Output: 5 Explanation: (101) in base 2 = (5) in base 10 Example 2: Input: head = [0] Output: 0 Example 3: Input: head = [1]..
Given an array nums of integers, return how many of them contain an even number of digits. Example 1: Input: nums = [12,345,2,6,7896] Output: 2 Explanation: 12 contains 2 digits (even number of digits). 345 contains 3 digits (odd number of digits). 2 contains 1 digit (odd number of digits). 6 contains 1 digit (odd number of digits). 7896 contains 4 digits (even number of digits). Therefore only ..
wand 라이브러리 설치 $ pip install wand 위의 라이브러리는 ImageMagick이라는 것을 활용하므로 이것도 같이 설치해주어야 합니다. ImageMagick 설치 Ubuntu 에서 설치하는 방법 sudo apt-get install libmagickwand-dev 위의 명령어로 설치한 이후에 사용할 설정을 수정해주면 완료입니다. [Python] wand.exceptions.PolicyError: not authorized `./test.pdf' @ error/constitute.c/ReadImage/412 해결방법 wand와 ImageMagick을 설치한 후 pdf를 tiff로 변환하려고 할 때 wand.exceptions.PolicyError: not authorized `./test..
wand와 ImageMagick을 설치한 후 pdf를 tiff로 변환하려고 할 때 wand.exceptions.PolicyError: not authorized `./test.pdf'@ error/constitute.c/ReadImage/412 위와 같은 오류를 만나게 되었습니다. 위는 imageMagick의 설정에 pdf 관련 설정이 none으로 설정되어있기 때문입니다. 이를 해결하는 방법은 다음과 같습니다. 먼저 설정을 변경할 파일을 vi 편집기로 열어줍니다. $ sudo vi /etc/ImageMagick-6/policy.xml $ sudo vi /etc/ImageMagick/policy.xml 위의 두 경로 중 본인의 설치 버전에 맞는 버전의 경로로 들어가면됩니다. 여러 부분 중에서 위의 부분을 ..
이 글에서는 자주 사용하는 정규식을 정리하려합니다. XXXX년 XX월 XX일 ( 년 월 일 형식 추출 정규식 ) import re value = "오늘은 2020년 12월 29일 입니다." pattern = r"\d+년 \d+월 \d+일" regex_result = re.search(pattern, value) result = regex_result.group() 특수문자 제거 정규식 import re regex_text = re.sub('[-=+,#/\?:^$.@*\"※~&%ㆍ!』\\‘|\(\)\[\]\`\'…》]', '', text) XX-XXX-XXXX | XX-XXXX-XXXX | XXX-XXX-XXXX | XXX-XXXX-XXXX ( 전화번호 추출 정규식 ) import re value = "내..