전체 글 188

Vundle로 Vim Plugin 구축

Ubuntu를 사용하면서 Vim을 자주 사용하는데개발에 도움이 되도록 플러그인을 사용한다고 해서 설치 Vundle 설치# github에서 Vundle.vim 설치 git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim Plugin 설정계정의 최상위 디렉터리에 .vimrc 파일 생성하고 다음 내용 삽입# 계정 최상위 디렉터리에 vim ~/.vimrc set nocompatible " be iMproved, required filetype off " required " set the runtime path to include Vundle and initialize set rtp+=~/.vim/bundle/Vundle.vim..

Anything 2020.09.21

Anaconda에서 Jupyter notebook

데이터 분석, 머신러닝, 딥러닝에 좋다고 해서 설치해봄먼저 Anaconda 가상환경에 접근해서 시작 # pip pip install --upgrade pip # tensorflow-gpu 설치 # jupyter notebook에서 사용할 것 pip install --ignore-installed --upgrade tensorflow-gpu # jupyter 설치 pip install jupyter # jupyter 실행 jupyter notebook 위와 같은 웹페이지로 Jupyter notebook이 실행됨오른쪽 위 메뉴로 Folder 생성, Python3 파일 생성,Python3 파일에서 tensorflow 모듈 사용 가능

Anything 2020.09.21

Ubuntu Anaconda 환경 설치

Anaconda는 라이브러리를 쉽게 설치하고 관리하는 도구필요한 라이브러리, 패키지를 지정해 가상 환경을 생성하고각 가상 환경이 서로에게 영향을 주지 않도록 논리적으로 구분된다. Anaconda 설치www.anaconda.com/products/individualAnaconda | Individual EditionAnaconda's open-source Individual Edition is the easiest way to perform Python/R data science and machine learning on a single machine.www.anaconda.com해당 URL 접근하여 다운로드 # 다운로드 링크로 이동 cd ~/Downloads # Shell Script 실행 bash An..

Anything 2020.09.21

Ubuntu zsh 설치

Shell 환경에서 사용성을 높여주는 zsh을 설치하고, zsh을 편하게 사용할 수 있게 해주는 oh-my-zsh을 설치한다.기본적으로 Ubuntu는 bash Shell을 제공한다. Ubuntu에 zsh 설치sudo apt-get install -y zsh #zsh 설치 which zsh #zsh 설치 경로 확인 chsh -s $(which zsh) # 기본 shell 변경oh-my-zsh 설치sudo apt-get install curl # url 읽어올 수 있게 sudo apt-get install git # git이 필요함 sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.s..

Anything 2020.09.21

2020. 08. 26 python

1) bifurcate : 영어의 뜻은, 물이 둘로 갈라지는 것, 2가지로 나누는 함수. def bifurcate(lst, filter): return [ [x for i, x in enumerate(lst) if filter[i] == True], [x for i, x in enumerate(lst) if filter[i] == False] ] enumerate(lst) : 반복문에서 리스트의 값을 인덱스와 함께 튜플로 반환함. (idx, value) 형태. return되는 값은 리스트 속의 리스트 형태로 반환됨. def bifurcate(lst, filter): return [ [x for i, x in enumerate(lst) if filter(x) >= 4], [x for i, x in enum..

Python 2020.08.26

2020. 08. 25 python

Filter_unique 리스트에서 유일한 value를 잡아내는 함수. 리스트에서 값들의 갯수를 찾아내기 위해 collections 모듈의 Counter 클래스를 사용한다. from collections import Counter def filter_unique(lst): return [item for item, count in Counter(lst).items() if count > 1] Counter(lst)는 딕셔너리를 출력한다. key = 리스트의 value, value = count 값 Counter(lst)를 통해 출력된 딕셔너리의 key와 value를 각각 item과 count로 넘기고 count > 1인 경우만 출력한다면 unique하지 않은 값을 출력할 수 있다. from collecti..

Python 2020.08.25

2020. 08. 24 python

30 seconds of code에서 python 함수들을 하나씩 공부할 것. group_by() def group_by(lst, fn): return {key : [el for el in lst if fn(el) == key] for key in map(fn, lst)} 함수는 리스트와 함수를 파라미터로 받는다. 해당 List를 Dictionary로 그룹화시키는 함수 [el for el in lst if fn(el) == key] 리스트를 생성하는데, 각 요소가 fn함수를 적용했을 때 key와 동일한 경우에 넣는다. {key : [el for el in lst if fn(el) == key] for key in map(fn, lst)} 아까 생성한 리스트를 value로 key와 함께 딕셔너리를 생성한다..

Python 2020.08.24
반응형