# left์ ์กด์ฌํ๋ Key๊ฐ ์๋ ๋ฐ์ดํฐ๋ง merge
df_merge_how_left = pd.merge(df_left, df_right, how='left', on='KEY')
# right์ ์กด์ฌํ๋ Key๊ฐ ์๋ ๋ฐ์ดํฐ๋ง merge
df_merge_how_right = pd.merge(df_left, df_right, how='right', on='KEY')
# left ๋ฐ right ์์ชฝ์ ์กด์ฌํ๋ Key๊ฐ ์๋ ๋ฐ์ดํฐ๋ง merge
df_merge_how_inner = pd.merge(df_left, df_right, how='inner', on='KEY')
# ์์ชฝ์ ์กด์ฌํ๋ ๋ชจ๋ Key๊ธฐ์ค merge
df_merge_how_outer = pd.merge(df_left, df_right, how='outer', on='KEY')
# ๊ฐ ๋ฐ์ดํฐ๊ฐ left, right ๋๋ ์์ชฝ์ ์ถ์ฒ์ธ์ง ํ์(_merge๋ ์ปฌ๋ผ์ ํ์)
pd.merge(df_left, df_right, how='outer', on='KEY', indicator=True)
#์์ชฝ์ ์ปฌ๋ผ๋ช
์ด ์ค๋ณต๋ ๋ _left๋ _right๋ฅผ ์ปฌ๋ผ๋ช
์ ์ถ๊ฐํจ
pd.merge(df_left_2, df_right_2, how='inner', on='KEY', suffixes=('_left', '_right'))
์ ์ฒด ๊ธ
- Dataframe Join 2019.11.04
- Linux์ ์ธ์ฆ์ ์ค์น 2019.11.02
- Linux Citrix Receiver ์ค์น์ libwebkit ์์กด์ฑ ๋ฌธ์ 2019.10.18
- Black Void Zsh ์ค์ 2019.10.12
- Linux์์ CapsLockํค๋ฅผ controlํค๋ก ๋ณ๊ฒฝํ๋๋ฒ 2019.10.04
- VIM Python 3 ์ง์ํ๋๋ก build 2019.09.25
- NeoVIM์ผ๋ก Python๊ฐ๋ฐํ๊ฒฝ ๊ตฌ์ถํ๊ธฐ 2019.09.25
- Linux ํ์ ์ ํธ๋ฆฌํฐ(๊ณ์ Update์์ ) 2019.09.06
- Manjaro Linux ssl error 2019.07.16
- Bagging & Boosting ์ฐจ์ด 2019.06.12
Dataframe Join
Linux์ ์ธ์ฆ์ ์ค์น
Installing a root/CA Certificate
Given a CA certificate file foo.crt, follow these steps to install it on Ubuntu:
-
Create a directory for extra CA certificates in /usr/share/ca-certificates:
sudo mkdir /usr/share/ca-certificates/extra -
Copy the CA .crt file to this directory:
sudo cp foo.crt /usr/share/ca-certificates/extra/foo.crt -
Let Ubuntu add the .crt file's path relative to /usr/share/ca-certificates to /etc/ca-certificates.conf:
sudo dpkg-reconfigure ca-certificatesTo do this non-interactively, run:
sudo update-ca-certificates
In case of a .pem file on Ubuntu, it must first be converted to a .crt file:
openssl x509 -in foo.pem -inform PEM -out foo.crt
Linux Citrix Receiver ์ค์น์ libwebkit ์์กด์ฑ ๋ฌธ์
1. Download the 3 required dependencies from Launchpad (not providing direct links so you can check it's legit):
a. https://launchpad.net/ubuntu/bionic/amd64/libicu60/60.2-3ubuntu3 (libicu60_60.2-3ubuntu3_amd64.deb (7.7 MiB))
b. https://launchpad.net/ubuntu/bionic/amd64/libjavascriptcoregtk-1.0-0/2.4.11-3ubuntu3
(libjavascriptcoregtk-1.0-0_2.4.11-3ubuntu3_amd64.deb (1.8 MiB))
c. https://launchpad.net/ubuntu/cosmic/amd64/libwebkitgtk-1.0-0/2.4.11-3ubuntu3
(libwebkitgtk-1.0-0_2.4.11-3ubuntu3_amd64.deb (7.7 MiB))
2. Install the files in that order in the terminal
(assuming the files are in the Downloads folder)
cd ~/Downloads sudo dpkg -i libicu60_60.2-3ubuntu3_amd64.deb sudo dpkg -i libjavascriptcoregtk-1.0-0_2.4.11-3ubuntu3_amd64.deb sudo dpkg -i libwebkitgtk-1.0-0_2.4.11-3ubuntu3_amd64.deb sudo dpkg -i icaclient_19.3.0.5_amd64.deb
This correctly installs Citrix Workspace. If you then get connection errors when trying to set it up, also implement step 3.
3. Fix the certificate error.
sudo ln -s /usr/share/ca-certificates/mozilla/* /opt/Citrix/ICAClient/keystore/cacerts/ sudo c_rehash /opt/Citrix/ICAClient/keystore/cacerts/
Black Void Zsh ์ค์
$ git clone https://github.com/black7375/BlaCk-Void-Zsh.git ~/.zsh
$ bash ~/.zsh/BlaCk-Void-Zsh.sh
Powerline Font ์ค์
$ sudo apt-get install fonts-powerline
or
# clone
$ git clone https://github.com/powerline/fonts.git --depth=1
# install
$ cd fonts
$ ./install.sh
# clean-up a bit
$ cd ..
$ rm -rf fonts
[์ถ์ฒ] ๋ฉ์ง ZSH ์ค์ !! (๋ค์ด๋ฒ ๋ฆฌ๋ ์ค ์ ์ ๊ทธ๋ฃน) |์์ฑ์ BlaCk7375
Linux์์ CapsLockํค๋ฅผ controlํค๋ก ๋ณ๊ฒฝํ๋๋ฒ
์์ฆ emacs๋ vi์๋ํฐ๋ฅผ ๋ง์ด ์ฐ๋ฉด์ controlํค๋ฅผ ์๋ผ ์๊ฐ๋ฝ์ผ๋ก ๋๋ฅด๋ ์ผ์ด ๋ง์์ก๋ค.
๋ณดํต์ ํค๋ณด๋์๋ controlํค๊ฐ ์ผ์ชฝ ์๋ ์กด์ฌํ๋ค ๋ณด๋ ์๋ผ ์๊ฐ๋ฝ์ด ๋ง์ด ๋ฌด๋ฆฌ๊ฐ ๊ฐ๋ค.
์๋ ์ unixํค๋ณด๋์ฒ๋ผ ๋ฐฐ์ด์ ๋ฐ๊ฟ์ ์ฌ์ฉํด๋ณด๋ ค๊ณ ํ๋ค.
# ๋จผ์ ์๋ ํ์ผ์ Editor๋ก ์ฐ๋ค.
$ sudo vi /etc/default/keyboard
# XKBOPTIONS์ ์ฐพ์ ctrl:nocaps๋ฅผ ์จ์ Caps Lockํค๋ฅผ ์ถ๊ฐ์ ์ผ๋ก Controlํค๋ก ์ฌ์ฉํ๋๋ก ํ๋ค.
# ๋๋ ctrl:swapcaps๋ฅผ ์จ์ Caps Lockํค์ Controlํค์ ๊ธฐ๋ฅ์ ๋ฐ๊พผ๋ค.
XKBOPTIONS="ctrl:nocaps"
# ๋ค์์ผ๋ก ๋ณ๊ฒฝ๋ ๋ด์ฉ์ด ๋ฐ์๋๋๋ก ์๋ ๋ช
๋ น์ด๋ฅผ ์คํํ๋ค.
$sudo dpkg-reconfigure keyboard-configuration
VIM Python 3 ์ง์ํ๋๋ก build
./configure --with-features=huge --enable-cscope --enable-multibyte --enable-python3interp --with-python3-config-dir=/usr/lib/python3.7/config-3.7m-x86_64-linux-gnu --enable-fail-if-missing
make
sudo make install
Fisa Vim Config (http://fisadev.github.io/fisa-vim-config/)
sudo apt-get install curl vim exuberant-ctags git ack-grep
sudo pip install pep8 flake8 pyflakes isort yapf
mv ~/.vimrc ~/.vimrc.org
wget -O ~/.vimrc https://raw.github.com/fisadev/fisa-vim-config/master/.vimrc
NeoVIM์ผ๋ก Python๊ฐ๋ฐํ๊ฒฝ ๊ตฌ์ถํ๊ธฐ
1. Neovim์ ์ค์นํ๋ค.
2. Nvim์ fisa-dev๋ฅผ ์ค์ ํ๋ค.
3. coc-nvim (intellisense plugin)์ ์ค์นํ๋ค.
๊ฐ. Node.js์ค์น
curl -sL install-node.now.sh/lts | sudo bash
๋. Yarn ์ค์น
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn
๋ค. VIM Plugin์ค์น
curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
๋ผ. ~/.config/nvim/init.vim์ ์๋ ๋ด์ฉ ์ถ๊ฐ
call plug#begin('~/.config/nvim/plugged')
" Use release branch
Plug 'neoclide/coc.nvim', {'branch': 'release'}
" Or latest tag
Plug 'neoclide/coc.nvim', {'tag': '*', 'branch': 'release'}
" Or build from source code by use yarn: https://yarnpkg.com
Plug 'neoclide/coc.nvim', {'do': 'yarn install --frozen-lockfile'}
call plug#end()
๋ง. nvim์คํํ coc ๋ชจ๋ ์ค์น
:CocInstall coc-json
:CocInstall coc-python
:CocInstall coc-pypl
๋ฐ. ./config/nvim/coc-settings.json ํ์ผ์ Python language server์ค์ ์ถ๊ฐ
{
"languageserver": {
"golang": {
"command": "gopls",
"rootPatterns": ["go.mod", ".vim/", ".git/", ".hg/"],
"filetypes": ["go"]
},
"ccls": {
"command": "ccls",
"filetypes": ["c", "cpp", "objc", "objcpp"],
"rootPatterns": [".ccls", "compile_commands.json", ".vim/", ".git/", ".hg/"],
"initializationOptions": {
"cache": {
"directory": "/tmp/ccls"
}
}
},
"python": {
"command": "python",
"args": [
"-mpyls",
"-vv",
"--log-file",
"/tmp/lsp_python.log"
],
"trace.server": "verbose",
"filetypes": [
"python"
],
"settings": {
"pyls": {
"enable": true,
"trace": {
"server": "verbose"
},
"commandPath": "",
"configurationSources": [
"pycodestyle"
],
"plugins": {
"jedi_completion": {
"enabled": true
},
"jedi_hover": {
"enabled": true
},
"jedi_references": {
"enabled": true
},
"jedi_signature_help": {
"enabled": true
},
"jedi_symbols": {
"enabled": true,
"all_scopes": true
},
"mccabe": {
"enabled": true,
"threshold": 15
},
"preload": {
"enabled": true
},
"pycodestyle": {
"enabled": true
},
"pydocstyle": {
"enabled": false,
"match": "(?!test_).*\\.py",
"matchDir": "[^\\.].*"
},
"pyflakes": {
"enabled": true
},
"rope_completion": {
"enabled": true
},
"yapf": {
"enabled": true
}
}
}
}
}
}
}
4. nvim default editor์ค์
sudo update-alternatives --install /usr/bin/vi vi /usr/bin/nvim 60
sudo update-alternatives --config vi
sudo update-alternatives --install /usr/bin/vim vim /usr/bin/nvim 60
sudo $ update-alternatives --config vim
sudo update-alternatives --install /usr/bin/editor editor /usr/bin/nvim 60
sudo update-alternatives --config editor
Linux ํ์ ์ ํธ๋ฆฌํฐ(๊ณ์ Update์์ )
1. Linux Outliner (Windows๋ ๊ฐ๋ฅ)
https://www.giuspen.com/cherrytree/#downl
-
Install wget and Cherrytree dependencies.
-
sudo apt install wget python-dbus python-chardet python-enchant libcanberra-gtk-module libgtksourceview2.0-0 libgtksourceview2.0-common python-cairo python-gobject-2 python-gtk2 python-numpy
-
Download python-gtksourceview2.
wget http://ftp.br.debian.org/debian/pool/main/p/pygtksourceview/python-gtksourceview2_2.10.1-3_amd64.deb
-
Install python-gtksourceview2.
sudo dpkg -i python-gtksourceview2_2.10.1-3_amd64.deb
-
Download Cherrytree.
wget http://www.giuspen.com/software/cherrytree_0.38.9-0_all.deb
-
Install Cherrytree.
sudo dpkg -i cherrytree_0.38.9-0_all.deb
2. Albert
๋งฅ์ ์ํ๋ ๋์ ๊ฐ์ ์ญํ ์ ํ๋ค.
Ctrl + tabํค๋ก ๋จ์ถํค๋ฅผ ์ง์ ํด๋์ผ๋ฉด ํธ๋ฆฌํ๋ค.
https://software.opensuse.org/download.html?project=home:manuelschneid3r&package=albert
3. ํ๊ธํฐํธ ์ค์
๋๋๊ธ๊ผด
$ sudo apt install fonts-nanum
๋๋๊ณ ๋ ์ฝ๋ฉ์ฒด
$ sudo apt install fonts-nanum-coding
4. shutter (Capture ํ๋ก๊ทธ๋จ)
sudo add-apt-repository ppa:linuxuprising/shutter
sudo apt install shutter
sudo apt remove --auto-remove shutter
4. Hangul Input Method
https://nimf-i18n.gitlab.io/ko/installation/
sudo apt-add-repository ppa:hodong/nimf -y
sudo apt update
sudo apt-get install im-config zenity
sudo apt install nimf nimf-libhangul -y
im-config -n nimf
5. Notebook Battery Saving
sudo add-apt-repository ppa:linrunner/tlpsudo
apt-get updatesudo
apt-get install tlp tlp-rdw
(์ฝํฌํจ๋ ์ ์ ๋ผ๋ฉด ์๋ ๋ด์ฉ ์ถ๊ฐ)sudo apt-get install tp-smapi-dkms acpi-call-dkms
6. ZSH Theme์ค์
powerlevel10k
https://github.com/romkatv/powerlevel10k
7. XFCE Terminal Theme
https://www.maketecheasier.com/best-xfce-terminal-themes/
https://github.com/nthirtyone/mariana-scheme
8. emacs์ต์ ๋ฒ์ (28๋ฒ์ )์ค์น
Repository๋ฅผ ์ถ๊ฐ ํ๋ค.
[28๋ฒ์ ]
sudo add-apt-repository ppa:ubuntu-elisp/ppa
sudo apt-get update
sudo apt install emacs-snapshot
[25๋ฒ์ ]
sudo add-apt-repository ppa:kelleyk/emacs
sudo apt-get update
sudo apt install emacs25
[26๋ฒ์ ]
sudo add-apt-repository ppa:kelleyk/emacs
sudo apt-get update
sudo apt install emacs26
[๊ธฐ๋ณธ ์๋ํฐ ๋ณ๊ฒฝ]
sudo update-alternatives --config emacs
user@user-desktop:~$ update-alternatives --config emacs
There are 2 choices for the alternative emacs (providing /usr/bin/emacs).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/bin/emacs-snapshot 27 auto mode
* 1 /usr/bin/emacs-snapshot 27 manual mode
2 /usr/bin/emacs24-x 27 manual mode
Manjaro Linux ssl error
ssl ์ธ์ฆ์(*.crt)ํ์ผ์ ์ค๋นํ๋ค.
# trust anchor localhost.crt
# trust extract-compat
/usr/lib/python3.7/site-packages/pacman_mirrors/functions/ ์๋์
httpFn.py๋ฅผ ์์ ํ๋ค.
context = ssl._create_unverified_context()
response = urllib.request.urlopen(requests, data=data.encode('utf-8'), context=context)
Bagging & Boosting ์ฐจ์ด
๋น๊ต | Bagging | Boosting |
ํน์ง |
๋ณ๋ ฌ ์์๋ธ ๋ชจ๋ธ (๊ฐ ๋ชจ๋ธ์ ์๋ก ๋ ๋ฆฝ์ ) |
์ฐ์ ์์๋ธ (์ด์ ๋ชจ๋ธ์ ์ค๋ฅ๋ฅผ ๊ณ ๋ ค) |
๋ชฉ์ | Variance ๊ฐ์ | Bias ๊ฐ์ |
์ ํฉํ ์ํฉ |
๋ณต์กํ ๋ชจ๋ธ (High Variance, Low Bias) |
Low Variance, High Bias ๋ชจ๋ธ |
๋ํ ์๊ณ ๋ฆฌ์ฆ | Random Forest | Gradient Boosting, AdaBoost |
Sampling | Randomg Sampling | Random Sampling with weight on error |
์ฐธ๊ณ : https://www.slideshare.net/freepsw/boosting-bagging-vs-boosting