[Python] importlib ์‚ฌ์šฉ์ž ์ •์˜ ๋ฆฌ๋กœ๋“œ
ยท
๐Ÿ Python
Sol 1) importlib์˜ reload( ) ํ•จ์ˆ˜ ์‚ฌ์šฉ (3.12 ์ดํ›„ imp ์ง€์› X) import example import importlib # make changes to example.py file importlib.reload(example) ๊ธฐ์กด์˜ sys.path.module์— ๋“ฑ๋ก๋œ module์„ reload ์‹œํ‚จ๋‹ค. ์ฃผ์˜ ํ•ด์•ผํ•  ๊ฒƒ์€ ์ ˆ๋Œ€ ๊ฒฝ๋กœ์— ์—†๋Š” module์ผ ๊ฒฝ์šฐ ์ ˆ๋Œ€ ๊ฒฝ๋กœ์— ๋“ฑ๋ก์„ ์‹œ์ผœ์ค˜์•ผํ•œ๋‹ค. Sol 2) JupyterNote Book์—์„œ Magic Command๋กœ reload ํ•˜๋Š” ๋ฐฉ๋ฒ• ๋”๋ณด๊ธฐ https://ipython.readthedocs.io/en/stable/config/extensions/autoreload.html autoreload — IPython 8.14..
[SQL] LEFT, REPLACE, SUBSTRING
ยท
๐Ÿ›ข๏ธ Database
PostgreSQL ๋ฌธ๋ฒ• ์˜ˆ์ œ Table - Ticker information ๋”๋ณด๊ธฐ NOTE https://www.postgresql.org/docs/current/functions-string.html 9.4. String Functions and Operators 9.4. String Functions and Operators 9.4.1. format This section describes functions and operators for examining and manipulating string values. Strings in … www.postgresql.org ๋ฌธ๋ฒ•์— ์•ž์„œ PostgreSQL์— ์‚ฌ์šฉ ๋˜๋Š” ๋ฌธ์ž์—ด ํ•จ์ˆ˜์™€ ์—ฐ์‚ฐ์ž ์‚ฌ์šฉ์‹œ SQL์€ ์‰ผํ‘œ๊ฐ€ ์•„๋‹Œ ํ‚ค์›Œ๋“œ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ธ์ˆ˜๋ฅผ ๊ตฌ๋ถ„ํ•˜๋Š” ..
[SQL] LIKE
ยท
๐Ÿ›ข๏ธ Database
https://www.postgresql.org/docs/current/functions-matching.html#FUNCTIONS-SIMILARTO-REGEXP 9.7. Pattern Matching 9.7. Pattern Matching 9.7.1. LIKE 9.7.2. SIMILAR TO Regular Expressions 9.7.3. POSIX Regular Expressions There are three separate approaches to pattern … www.postgresql.org [Postgre Document] 9.7.1. LIKE LIKE ์—ฐ์‚ฐ์ž๋Š” SQL ํ‘œ์ค€์— ๋”ฐ๋ผ ํŒจํ„ด์„ ๊ธฐ๋ฐ˜์œผ๋กœ ๋ฌธ์ž์—ด์„ ๋น„๊ตํ•˜๊ธฐ ์œ„ํ•ด ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค. LIKE ํŒจํ„ด์€ ๋‹ค์Œ๊ณผ ๊ฐ™์€ ๊ตฌ๋ฌธ์œผ๋กœ ์‚ฌ์šฉ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค..
[Google Search Console] ๋ฌธ์ž์—ด์˜ ์ด์Šค์ผ€์ดํ”„ ์‹œํ€€์Šค๊ฐ€ ์ž˜๋ชป๋จ + Latex
ยท
๐Ÿƒ Routine
"๋ฌธ์ž์—ด์˜ ์ด์Šค์ผ€์ดํ”„ ์‹œํ€€์Šค๊ฐ€ ์ž˜๋ชป๋จ" + Latex Escape Letter ์˜ค๋ฅ˜ $z = \mu + \epsilon\sigma$ ๋ฐ”๋กœ Backslash๊ฐ€ JavaScript์˜ escape ๋ฌธ์ž๋กœ Google Search Console ํฌ๋กค๋Ÿฌ๊ฐ€ \mu๋ฅผ ํ•จ์ˆ˜๋กœ ์ธ์‹ํ•ด ์ƒ๊ธฐ๋Š” ์˜ค๋ฅ˜์ด๋‹ค. ์ฒ˜์Œ์— JavaScript๋ฅผ ์ž˜ ๋ชฐ๋ผ latex๋กœ ์“ฐ๊ณ  ์บก์ณํ•ด์„œ ํฌ์ŠคํŒ…ํ•˜๋‹ค. Escape ๋ฌธ์ž ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•์„ ์ฐพ์•˜๋‹ค. https://docs.mathjax.org/en/v2.1-latest/tex.html MathJax TeX and LaTeX Support — MathJax 2.1 documentation The support for TeX and LaTeX in MathJax consists of two parts: t..
[SQL] NULLIF, NVL(COALESCE) ํ•จ์ˆ˜
ยท
๐Ÿ›ข๏ธ Database
NULLIF NULLIF ํ‘œํ˜„์‹์€ ๋‘ ์ธ์ˆ˜๋ฅผ ๋น„๊ตํ•˜์—ฌ ๋™์ผํ•œ ๊ฒฝ์šฐ์—๋Š” NULL์„ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. ๋™์ผํ•˜์ง€ ์•Š์œผ๋ฉด ์ฒซ ๋ฒˆ์งธ ์ธ์ˆ˜๊ฐ€ ๋ฐ˜ํ™˜๋ฉ๋‹ˆ๋‹ค. ์ด ํ‘œํ˜„์‹์€ NVL ๋˜๋Š” COALESCE ํ‘œํ˜„์‹์˜ ์ •๋ฐ˜๋Œ€์ž…๋‹ˆ๋‹ค. ERROR: Divide by zero (NULL ๊ฐ’์œผ๋กœ ์ƒ๊ธฐ๋Š” ์˜ค๋ฅ˜) NULL ๊ฐ’์œผ๋กœ ๋‚˜๋ˆŒ ๊ฒฝ์šฐ Divide by zero ์—๋Ÿฌ๋ฅผ ๋งŒ๋‚˜๊ฒŒ ๋œ๋‹ค. ์ด ๊ฒฝ์šฐ NULLIF๋กœ ์ผ๋ถ€ ํ•ด๊ฒฐํ•  ์ˆ˜ ์žˆ๋‹ค. ** ์—ฐ์‚ฐ์— NULL์ด ์žˆ์„ ๊ฒฝ์šฐ ๋ชจ๋“  ์—ฐ์‚ฐ์€ NULL์„ ๋ฐ˜ํ™˜ํ•œ๋‹ค.
[SQL] Count ํ•จ์ˆ˜, Sequel vs SQL
ยท
๐Ÿ›ข๏ธ Database
Null ๊ฐ’์— ๋”ฐ๋ผ ๋ณ€ํ•˜๋Š” Count function ์˜ˆ์‹œ ํ…Œ์ด๋ธ” (table=account) Case 1) SELECT COUNT(1) FROM account; Result : 4; COUNT(1) : for i in row: row_count+=1; ๊ณผ ๊ฐ™์ด ์ „์ฒด row ์ˆ˜๋ฅผ ํ•˜๋‚˜ํ•˜๋‚˜ ๋”ํ•ด ๊ฐ’์„ ๋ฐ˜ํ™˜ํ•œ๋‹ค. COUNT(1) = COUNT(*) = total_row_count๋ผ๊ณ  ๋ด๋„ ๋ฌด๋ฐฉํ•˜๋‹ค. Case 2) SELECT COUNT(Name) FROM account; Result : 3 COUNT(Name) Name ์ปฌ๋Ÿผ์—์„œ Null์„ ์ œ์™ธํ•œ ์—ด์˜ ์ˆ˜๋ฅผ ๋ฐ˜ํ™˜ํ•œ๋‹ค. Case 3) SELECT COUNT(DISTINCT Name) FROM account; Result : 2 DISTINCT๋Š” Null์„ ์ œ์™ธ..
๋‹คํ–ˆ๋‹ค
B's