728x90

๋ฐ์ดํ„ฐ๋ถ„์„ 26

[์›นํฌ๋กค๋ง] Python์œผ๋กœ ์›น ํฌ๋กค๋ง, HTML ํŒŒ์‹ฑ, requests, BeautifulSoup ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์ด์šฉ

์›น ํฌ๋กค๋ง์œผ๋กœ href ํƒœ๊ทธ์˜ ๊ฐ’ ๊ฐ€์ ธ์˜ค๊ธฐ (HTML ํŒŒ์‹ฑ) import requests from bs4 import BeautifulSoup ftp.ensembl.org/pub/current_regulation/homo_sapiens/RegulatoryFeatureActivity/ Index of /pub/current_regulation/homo_sapiens/RegulatoryFeatureActivity/ ftp.ensembl.org ์ด๋ ‡๊ฒŒ ์ƒ๊ธด ์›น ํ˜•ํƒœ์—์„œ ๋ฐ์ดํ„ฐ ์ด๋ฆ„๋งŒ ๊ฐ€์ ธ์˜ค๋Š” ์›น ํฌ๋กค๋ง ์‹ค์Šต. 1. requests ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์ด์šฉํ•ด url get ํ•˜๊ธฐ import requests from bs4 import BeautifulSoup res = requests.get('http://ftp.en..

[Python] Pandas Dataframe ์ž๋ฃŒํ˜•์—์„œ NaN ๊ฐ’ ์ฐพ๊ธฐ(๊ฒฐ์ธก๊ฐ’ ์—ฌ๋ถ€ ํ™•์ธ, ๊ฒฐ์ธก๊ฐ’ ๊ฐœ์ˆ˜ ์„ธ๊ธฐ)

How to check NaN in Pandas Dataframe null ๊ฐ’ ํ™•์ธ df.isnull() isnull(df) null ์•„๋‹Œ ๊ฐ’ ํ™•์ธ df.notnull() notnull(df) 1. ์˜ˆ์‹œ dataframe ์ƒ์„ฑ import pandas as pd import numpy as np dates = pd.date_range("20130101", periods=6) df = pd.DataFrame(np.random.randn(6, 4), index=dates, columns=list("ABCD")) 2. null ๊ฐ’ ์ถ”๊ฐ€ํ•˜๊ธฐ 'NaN' ํ˜น์€ None์„ ํ†ตํ•ด null๊ฐ’์„ ์ž„์˜๋กœ ์ถ”๊ฐ€ํ•  ์ˆ˜ ์žˆ๋‹ค. df['A'][1] = 'NaN' df['B'][2] = None df['C'][2] = 'NaN' d..

[MySQL] ๋‚ด์žฅํ•จ์ˆ˜ - ๋ฌธ์ž์—ด ํ•จ์ˆ˜

ASCII(์•„์Šคํ‚ค์ฝ”๋“œ), CHAR(์ˆซ์ž) SELECT ASCII('A'), CHAR(65); --> 65, A๋ฐ˜ํ™˜ BIT_LENGTH, CHAR_LENGHT, LENGTH BIT_LENGTH(): ํ• ๋‹น๋œ ๋น„ํŠธํฌ๊ธฐ ๋ฐ˜ํ™˜ CHAR_LENGTH(): ๋ฌธ์ž ๊ฐœ์ˆ˜ ๋ฐ˜ํ™˜ LENGTH(): ํ• ๋‹น๋œ ๋ฐ”์ดํŠธ ์ˆ˜ ๋ฐ˜ํ™˜ ์˜๋ฌธ: ๋ฌธ์ž๋‹น 1๋ฐ”์ดํŠธ, ํ•œ๊ธ€: ๋ฌธ์ž๋‹น 3๋ฐ”์ดํŠธ SELECT BIT_LENGTH('ABC'), CHAR_LENGTH('ABC), LENGTH('ABC); --24, 3, 3๋ฐ˜ํ™˜ SELECT BIT_LENGTH('๊ฐ€๋‚˜๋‹ค'), CHAR_LENGTH('๊ฐ€๋‚˜๋‹ค'), LENGTH('๊ฐ€๋‚˜๋‹ค'); -- 72, 3, 9 ๋ฐ˜ํ™˜ CONCAT(๋ฌธ์ž์—ด1, ๋ฌธ์ž์—ด2, ...), CONCAT_WS(๋ฌธ์ž์—ด1, ๋ฌธ์ž์—ด2, ...) CO..

DB(Database)/MySQL 2021.01.20

[MySQL] MySQL ๋ณ€์ˆ˜ ์‚ฌ์šฉ๋ฐฉ๋ฒ•(SET, PREPARE, EXECUTE)๊ณผ ๋ฐ์ดํ„ฐ ํ˜•์‹ ๋ณ€ํ™˜ ํ•จ์ˆ˜(CAST, CONVERT,CONCAT), ๋‚ด์žฅํ•จ์ˆ˜(์ œ์–ดํ•จ์ˆ˜ IF, IFNULL, NULLIF, CASE WHEN ELSE END)

๋ณ€์ˆ˜ ์‚ฌ์šฉ ํ˜•์‹ SET @๋ณ€์ˆ˜๋ช… = ๋ณ€์ˆ˜๊ฐ’; -- ๋ณ€์ˆ˜ ์„ ์–ธ, ๊ฐ’ ๋Œ€์ž… SELECT @๋ณ€์ˆ˜์ด๋ฆ„; -- ๋ณ€์ˆ˜ ์ถœ๋ ฅ ์˜ˆ์ œ SET @VAR1 = 1; SET @VAR2 = 2; SELECT @VAR1; -- ๊ฒฐ๊ณผ 1 SELECT @VAR1 + @VAR2; -- ๊ฒฐ๊ณผ 2 SET, PREPARE, EXECUTE ๋ฌธ SET @VAR1 = 1; PREPARE Query FROM 'SELECT * FROM [ํ…Œ์ด๋ธ”๋ช…] ORDER BY [์ •๋ ฌ๊ธฐ์ค€] LIMIT ?'; -- '?'์œ„์น˜์— ๋ณ€์ˆ˜ ์‚ฌ์šฉํ•ด ์ฟผ๋ฆฌ๋ฌธ PREPARE EXECUTE Query USING @VAR1; -- ๋ณ€์ˆ˜ ์‹คํ–‰๋ฌธ ๋ฐ์ดํ„ฐ ํ˜•์‹ ๋ณ€ํ™˜ ํ•จ์ˆ˜ CONVERT(), CAST(): ๊ฐ•์ œ๋กœ ๋ฐ์ดํ„ฐํ˜•์„ ๋ณ€ํ™˜ํ•˜๋Š” ํ•จ์ˆ˜ -- ๋ฐ์ดํ„ฐ๋ฅผ ์ •์ˆ˜๋กœ ์ถœ๋ ฅ SELECT CAST([..

DB(Database)/MySQL 2021.01.20

Biopython ์œผ๋กœ ์—ญ์ƒ๋ณด์„œ์—ด ๊ตฌํ•˜๊ธฐ

Biopython ์„ค์น˜ ํ›„ reverse complement ์„œ์—ด ๊ตฌํ•˜๊ธฐ Biopython ์„ค์น˜ pip install biopython ์„ค์น˜ ํ™•์ธ ๋ฐ reverse_complement ์ฝ”๋“œ ์‹คํ–‰ import Bio # ์„ค์น˜ํ™•์ธ from Bio.Seq import Seq my_seq = Seq('TGGTGAAACCCCA').reverse_complement() print(my_seq) print(type(my_seq)) ๊ฒฐ๊ณผ sequence์˜ ํƒ€์ž… ํ™•์ธ ๊ฒฐ๊ณผ ์ฐธ๊ณ : biopython.org/wiki/Getting_Started · Biopython OB— title: Getting Started permalink: wiki/Getting_Started layout: wiki — Download and In..

Bioinfomatics 2021.01.19

[์ œ 26ํšŒ ๋ฐ์ดํ„ฐ๋ถ„์„ ์ค€์ „๋ฌธ๊ฐ€ ์ž๊ฒฉ๊ฒ€์ •] 20.08.29 ADsP ํ•ฉ๊ฒฉ ํ›„๊ธฐ

blog.naver.com/ahnty0122/222103415093 [์ œ 26ํšŒ ๋ฐ์ดํ„ฐ๋ถ„์„ ์ค€์ „๋ฌธ๊ฐ€ ์ž๊ฒฉ๊ฒ€์ •] 20.08.29 ADsP ํ•ฉ๊ฒฉ ํ›„๊ธฐ ADsP ์ผ์ฃผ์ผ ๊ณต๋ถ€ํ•˜๊ณ  ํ•ฉ๊ฒฉํ•˜๊ธฐ๋Œ€ํ•™๊ต 1ํ•™๋…„ ๋•Œ ์ ค ์žฌ๋ฐŒ๊ฒŒ ๋“ค์—ˆ๋˜ ๊ณผ๋ชฉ์ด ํ™•๋ฅ ๋ฐํ†ต๊ณ„ํ•™ .... ์ด์—ˆ๊ณ tmi... blog.naver.com

[DB] SQL์˜ ๋ถ„๋ฅ˜(DML, DDL, DCL)

SQL์˜ ๋ถ„๋ฅ˜ DML (Data Manipulation Language) DDL (Data Definition Language) DCL (Data Control Language) DML (Data Manipulation Language) ๋ฐ์ดํ„ฐ ์กฐ์ž‘ ์–ธ์–ด SELECT, INSERT, DELETE, UPDATE ๋“ฑ ํŠธ๋žœ์žญ์…˜ ๋ฐœ์ƒ-->๋กค๋ฐฑ์œผ๋กœ ์ทจ์†Œ ๊ฐ€๋Šฅ (rollback;) ํŠธ๋žœ์žญ์…˜: ํ…Œ์ด๋ธ”์˜ ๋ฐ์ดํ„ฐ๋ฅผ ๋ณ€๊ฒฝํ•  ๋•Œ ๋ฐ”๋กœ ์ ์šฉํ•˜๋Š” ๊ฒƒ์ด ์•„๋‹ˆ๊ณ  ์ž„์‹œ๋กœ ์ ์šฉ์‹œํ‚ค๋Š” ๊ฒƒ ์ปค๋ฐ‹(COMMIT): ํŠธ๋žœ์žญ์…˜์˜ ์‹คํ–‰ ๊ฒฐ๊ณผ๋ฅผ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์— ๋ฐ˜์˜ํ•˜๋Š” ๊ฒƒ ์ทจ์†Œ(ROLLBACK): ํŠธ๋žœ์žญ์…˜์˜ ์‹คํ–‰ ๊ฒฐ๊ณผ๋ฅผ ๋ฐ˜์˜ํ•˜์ง€ ์•Š๊ณ  ์›๋ž˜ ์ƒํƒœ๋กœ ๋˜๋Œ๋ฆฌ๋Š” ๊ฒƒ DDL (Data Definition Language) ๋ฐ์ดํ„ฐ ์ •์˜ ์–ธ์–ด CREATE, DR..

728x90