뚝딱이 — 뚝딱이

전체 글

IT 공부 일지
Python/numpy & Pytorch

[Numpy] random 서브 모듈

https://codetorial.net/numpy/random.html Matplotlib와 함께 정리가 잘된 사이트 NumPy 난수 생성 (Random 모듈) - Codetorial 예제1 - 기본 사용 import numpy as np a = np.random.randn(5) print(a) b = np.random.randn(2, 3) print(b) sigma, mu = 1.5, 2.0 c = sigma * np.random.randn(5) + mu print(c) [ 0.06704336 -0.48813686 0.4275107 -0.9015714 -1.30597604] [[ 0.87354043 0.03783 codetorial.net Random 서브 모듈 Random 모듈에 있는 다양한 함수를..

기타/Jupyter

[Jupyter] method, parameter 확인하기

1. method 확인 방법 사용하고자 하는 객체에 '.'을 치고 tab 을 눌러 확인 가능 2. parameter 확인 방법 파라미터 값이 기억이 안날 때 함수, 메소드를 () 까지 다 치고 shift+tab 을 쳐서 확인 가능

Coding Test/programmers

[Python] 파이썬 프로그래머스 신규 아이디 추천

https://school.programmers.co.kr/learn/courses/30/lessons/72410 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr import re def solution(new_id): answer = '' # 1 ~ 3 new_id = new_id.lower() new_id = re.sub('[^a-z0-9\-\_\.]', '', new_id) new_id = re.sub('\.+','.',new_id) # 4 try: if new_id[0] == '.': new_id = new_id[1:] if new_id[-1] ==..

Coding Test/programmers

[Python] 파이썬 프로그래머스 로또의 최고 순위와 최저 순위

https://school.programmers.co.kr/learn/courses/30/lessons/77484 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr def solution(lottos, win_nums): answer = [0, 0] lott = len(set(lottos) & set(win_nums)) sec = lottos.count(0) if lott == 0 and sec == 0: answer[0] = 6 else: answer[0] = (len(lottos)+1) - (lott + sec) if lott == 0: answer[1]..

ERROR

[Opencv] ModuleNotFoundError: No module named 'cv2'

import cv2 라이브러리가 설치되지 않아서 생기는 에러 커맨드 창 pip install opencv-python Jupyter notebook 커맨드 라인 !pip install opencv-python

기타/Jupyter

[Jupyter] pip instasll

Jupyter notebook에서 pip install 하는 법 !pip install 라이브러리명 Jupyter 커맨드 라인에서 작성후 실행시키면 설치됨 cmd에서 쳐도 설치됨 pip install 라이브러리

Coding Test/programmers

[Python] 파이썬 프로그래머스 짝지어 제거하기

https://school.programmers.co.kr/learn/courses/30/lessons/12973?language=python3 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr stack을 사용하여구현 def solution(s): s1 = list() if len(s)%2 == 1: return 0 for w in s: s1.append(w) if len(s1)>=2: if s1[-1] == s1[-2]: s1.pop() s1.pop() if s1 == []: return 1 else: return 0 좋아요 많은 코드 def soluti..

Coding Test/programmers

[Python] 파이썬 프로그래머스 신고 결과 받기

https://school.programmers.co.kr/learn/courses/30/lessons/92334 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr def solution(id_list, report, k): answer = [] report = list(set(report)) dict_id_mail = {name : 0 for name in id_list} dict_id_report= {name : [] for name in id_list} for i in report: person1 = i.split()[0] person2 = i.spli..

파송송
뚝딱이