๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ


Python

(75)
[Python] List - List ๋นผ๊ธฐ a = [1,2,3] b = [1,2] [x for x in a if x not in b] [3] https://zetawiki.com/wiki/Python_%EB%A6%AC%EC%8A%A4%ED%8A%B8_%ED%95%A9%EC%A7%91%ED%95%A9,_%EA%B5%90%EC%A7%91%ED%95%A9,_%EC%B0%A8%EC%A7%91%ED%95%A9,_%EB%8C%80%EC%B9%AD%EC%B0%A8 Python ๋ฆฌ์ŠคํŠธ ํ•ฉ์ง‘ํ•ฉ, ๊ต์ง‘ํ•ฉ, ์ฐจ์ง‘ํ•ฉ, ๋Œ€์นญ์ฐจ - ์ œํƒ€์œ„ํ‚ค ๋‹ค์Œ ๋ฌธ์ž์—ด ํฌํ•จ... zetawiki.com
[Python] Pandas - Dataframe.merge()์—์„œ copy ์˜ต์…˜ pandas.merge(left, right, how='inner', on=None, left_on=None, right_on=None, left_index=False, right_index=False, sort=False, suffixes='_x', '_y', copy=True, indicator=False, validate=None) https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.merge.html pandas.merge — pandas 1.1.4 documentation If True, adds a column to the output DataFrame called “_merge” with information on the so..
[Python] psycopg2 ์„ค์น˜ ์˜ค๋ฅ˜ flask, postgresql ์—ฐ๋™ ํ•˜๊ธฐ ์œ„ํ•ด์„œ psycopg2๋ฅผ ์„ค์น˜ ํ•˜๋ ค๊ณ  ํ–ˆ๋‹ค. $ pip3 install flask-sqlacodegen $ pip3 install psycopg2 ์˜ค๋ฅ˜ ๋ฐœ์ƒ ใ… ใ…  * libpq-dev ํŒจํ‚ค์ง€ ์„ค์น˜ ํ•„์š” zoomadmin.com/HowToInstall/UbuntuPackage/libpq-dev How to install libpq-dev ubuntu package on Ubuntu 18.04/Ubuntu 19.04/Ubuntu 16.04 How To Install "libpq-dev" Package on Ubuntu Quick Install Instructions of libpq-dev on Ubuntu Server. It’s Super Easy! simply c..
[Python] ๋‘ ๋ฌธ์ž์—ด ์ผ์น˜์œจ ๊ณ„์‚ฐ from difflib import SequenceMatcher a_str = 'abcd' b_str = 'bcd' SequenceMatcher(None, a_str, b_str).ratio() 0.8571428571428571 match_rate = f'{SequenceMatcher(None, a_str, b_str).ratio()*100:.1f}%' match_rate '85.7%' https://hoze.tistory.com/1741 ๋‘ ๋ฌธ์ž์—ด์„ ๋น„๊ตํ•˜์—ฌ ์ผ์น˜์œจ ๊ตฌํ•˜๊ธฐ ํ”„๋ž‘์Šค์–ด ๋ฒˆ์—ญ๋ณธ์˜ ์ƒ๋‹น ๋ถ€๋ถ„์ด ๊ตฌ๊ธ€์˜ ๋ฒˆ์—ญ๊ณผ ๊ณ ์Šค๋ž€ํžˆ ์ผ์น˜ํ•œ๋‹ค. ๋ฒˆ์—ญ์‚ฌ๊ฐ€ ์ œ๋Œ€๋กœ ์ผํ•œ ๊ฒƒ์ผ๊นŒ ์˜๊ตฌ์‹ฌ์ด ๋“ค ๋งŒํ•˜๋‹ค. ๋‹ค๋ฅธ ๋ฒˆ์—ญ์‚ฌ์—๊ฒŒ ๊ต์—ด์„ ๋งก๊ฒผ๋Š”๋ฐ ๋ณ„ ๋ฌธ์ œ๊ฐ€ ์—†๋‹ค๋Š” ๋‹ต๋ณ€์ด ๋Œ์•„์™”๋‹ค๊ณ  hoze.tistory.com https://cod..
[Python] ์˜ˆ์™ธ ๋ฐœ์ƒ ์‹œํ‚ค๊ธฐ, ๋ฉ”์„ธ์ง€ ์ถœ๋ ฅ try: a = 1/0 except: raise Exception('์˜ค๋ฅ˜ ๋ฐœ์ƒ')
[Python] cx_Oracle ํ•œ๊ธ€ ๊นจ์ง import cx_Oracle import os os.environ['NLS_LANG'] = '.UTF8' os.environ['NLS_LANG'] = '.UTF8' ์ถ”๊ฐ€
[Python] Dataframe - row ์ถ”๊ฐ€ append ์‚ฌ์šฉ data = {'a': 123, 'b':34123} df = df.append(data)
[Python] matplotlib - plot outside text plot ๋ฐ”๊นฅ์ชฝ์— text ์“ฐ๊ธฐ plt.text(1.03, 0.95, textstr, transform=ax.transAxes, fontsize=14, verticalalignment='top', bbox=props) import numpy as np import matplotlib.pyplot as plt np.random.seed(19680801) fig, ax = plt.subplots() x = 30*np.random.randn(10000) mu = x.mean() median = np.median(x) sigma = x.std() textstr = '\n'.join(( r'$\mu=%.2f$' % (mu, ), r'$\mathrm{median}=%.2f$' % (median, ), r'$\sig..