일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 파이썬
- 리눅스
- matplotlib
- 통계학
- 딥러닝
- 매틀랩
- 시각화
- MATLAB
- Tistory
- 텐서플로
- MySQL
- 서평단
- Blog
- 월간결산
- tensorflow
- 티스토리
- Google Analytics
- Linux
- python visualization
- SQL
- Python
- Ga
- 독후감
- Pandas
- 블로그
- 서평
- 한빛미디어
- 한빛미디어서평단
- 파이썬 시각화
- Visualization
- Today
- Total
목록Python (197)
pbj0812의 코딩 일기

0. 목표 - 회사 홈페이지의 하트표의 숫자값을 가져와서 구글 스프레드 시트에 넣음 - beautifulsoup만으로는 값을 뽑아낼 수 없어 selenium 적용 1. 필요 준비물 1) 라이브러리 설치 pip install beautifulsoup4 pip install selenium 2) 크롬 설치 - 링크 3) 크롬 드라이버 설치 - 링크 * 버전은 크롬의 버전에 맞게 다운로드 한다. - 크롬 버전 확인 - 주소창에 chrome://version/ 2. 코드 작성 1) 라이브러리 불러오기 from selenium import webdriver from bs4 import BeautifulSoup 2) 크롬 드라이버 경로 설정 driver = webdriver.Chrome('/Users/pbj0812..

0. 말머리 이 링크를 따라 학습하며 만들었습니다. 보다 자세한 설명은 위 링크를 타고 가시면 되나, 그 동안에 버전업이 되어 출력 결과는 이 글이 최신입니다. 1. 라이브러리 설치 1) gspread 설치 pip install gspread 2) oauth2client 설치 pip install --upgrade oauth2client 2. API 부여받기 - Google APIs 접속 : 링크 - 우측의 만들기 클릭 - 정보 입력 - 사용자 인증 정보 클릭 이후 우측 아래의 서비스 계정 관리 클릭 - 계정 생성 - 키 만들기 - json 파일로 다운로드 이후 완료 클릭 3. 코드 작성 0) 샘플 파일 작성 - 구글 스프레드 시트 작성 - 공유를 눌러 위에서 받은 json 파일 안에 있는 client_..
1. elasticsearch 모듈 설치 - 버전에 맞는 pip를 사용하여 설치 pip install elasticsearch 2. elasticsearch 실행 - 콘솔 추가 및 elasticsearch를 실행 - elasticsearch 설치 elasticsearch 3. python 작업 1) 라이브러리 불러오기 from elasticsearch import Elasticsearch from elasticsearch import helpers 2) elasticsearch 연결 - elasticsearch의 주소 입력(로컬에 그냥 깔기만 했다면 127.0.0.1:9200) es = Elasticsearch('http://127.0.0.1:9200') es.info() 3) 함수 생성 - 만약, 동일..

1. 서론 - Matlab을 만든 MathWorks 사에서 Python 과 Matlab 간의 호환을 위한 API 제작 및 배포 (링크) - 하지만 Matlab이 설치되어 있지 않은 환경에서는 사용 불가 * '시스템에 지원되는 버전의 Python과 MATLAB R2014b 이상이 설치되어 있는지 확인합니다.' 명시 - 대체품 검색 - Oct2Py 라는 라이브러리가 m-file을 Python 내에서 사용 할 수 있게 만든다는 글 확인 2. Oct2Py 설치(링크) 2.1. 설치 전 환경설정(링크) - Octave 4.0 이상 설치 필요(Octave 설치 링크) - Numpy, Scipy 설치 필요(Anaconda 설치 추천)(Anaconda 설치 링크) 2.2. 설치 pip install oct2py # p..
1. __init__ class Member: def __init__(self,id, pwd): self.id = id self.pwd = pwd def getId(self): print self.id, self.pwd test = Member("pbj", 123) test.getId() - __init__ 메소드는 주로 클래스를 통해 새로운 인스턴스를 생성할 때 세부 정보를 입력 하기 위하여 사용한다. - 위 예제를 보면 test 라는 새로운 인스턴스에 Member 클래스를 부르는데, 이때 id와 pwd를 같이 입력해 주는 것을 볼 수 있다. 2. 사용하는 이유 class Member2: def setId(self, id, pwd): self.id = id self.pwd = pwd def getId(..

1. 정의 k-평균 알고리즘(K-means algorithm)은 주어진 데이터를 k개의 클러스터로 묶는 알고리즘으로, 각 클러스터와 거리 차이의 분산을 최소화하는 방식으로 동작한다. 이 알고리즘은 자율 학습의 일종으로, 레이블이 달려 있지 않은 입력 데이터에 레이블을 달아주는 역할을 수행한다. 이 알고리즘은 EM 알고리즘을 이용한 클러스터링과 비슷한 구조를 가지고 있다. 2. 절차 1) 초기 (군집의) 중심으로 k개의 객체를 임의로 선택한다. 2) 각 자료를 가장 가까운 군집 중심에 할당한다. 3) 각 군집 내의 자료들의 평균을 계산하여 군집의 중심을 갱신(update)한다. 4) 군집 중심의 변화가 거의 없을 때(또는 최대 반복수)까지 2) 와 3) 을 반복한다. * 군집의 수(k)는 미리 정해 주어야..
import sysimport math # Auto-generated code below aims at helping you parse# the standard input according to the problem statement. n, r = [int(i) for i in input().split()]l = [i*r for i in range(n)]print(*l)
print(sum(ord(x) for x in input()))
import sysimport math # Auto-generated code below aims at helping you parse# the standard input according to the problem statement. n = int(input())q=""for i in input().split(): digit = int(i) q+=str(digit)# Write an action using print# To debug: print("Debug messages...", file=sys.stderr)print(0 if int(q)==0 else "".join(sorted(q)[::-1]))
import sysimport math # Auto-generated code below aims at helping you parse# the standard input according to the problem statement. s = input() # Write an action using print# To debug: print("Debug messages...", file=sys.stderr) t = 0for c in s.lower(): t += ord(c) - ord('a') + 1print(t)