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


Python

(75)
[Oauth] Google, email ์ •๋ณด ์–ป๊ธฐ serviceName='oauth2', version='v2' ์„œ๋น„์Šค๋ช…, ๋ฒ„์ „ ๋ญ˜๋กœ ํ•ด์•ผํ• ์ง€ ๋ชฐ๋ผ์„œ email ์ •๋ณด ์–ป๊ธฐ ํ•œ์ฐธ ํ—ค๋งด ใ…  ใ…  ์„œ๋น„์Šค๋ช… ์ •๋ณด ์žˆ๋Š” ๊ณณ ์•„์‹œ๋Š” ๋ถ„ ์•Œ๋ ค์ฃผ์„ธ์šง! import googleapiclient.discovery def get_user_info(credentials): """Send a request to the UserInfo API to retrieve the user's information. Args: credentials: oauth2client.client.OAuth2Credentials instance to authorize the request. Returns: User information as a dict. """ user_info_service = go..
OAuth ๊ตฌ๊ธ€ ์ธ์ฆ ๊ณผ์ • ์ฐธ๊ณ  ์‚ฌ์ดํŠธ Sign In/Authorize Revoke access developers.google.com/identity/protocols/oauth2/web-server#prerequisites Using OAuth 2.0 for Web Server Applications | Google ID ํ”Œ๋žซํผ This document explains how web server applications use Google API Client Libraries or Google OAuth 2.0 endpoints to implement OAuth 2.0 authorization to access Google APIs. OAuth 2.0 allows users to share specific data with an applic..
[Python] matplotlib - plot ์ˆ˜์ง์„ , ์ˆ˜ํ‰์„  ๊ทธ๋ฆฌ๊ธฐ import matplotlib.pyplot as plt plt.plot([1,2,3,4,5],[1,2,3,4,5]) # vertical lines, x=2, y = 1~4 plt.vlines(2, 1, 4) # horizontal lines, y=2, x=1~5 plt.hlines(2, 1, 5, 'y') plt.show() https://matplotlib.org/api/_as_gen/matplotlib.pyplot.vlines.html matplotlib.pyplot.vlines — Matplotlib 3.3.1 documentation Plot vertical lines. Plot vertical lines at each x from ymin to ymax. Note In addition to t..
[Python] matplotlib - plot ์ด๋ฏธ์ง€ ์ €์žฅ import matplotlib.pyplot as plt plt.(x, y) plt.savefig('figure.png', dpi=80)
[Python] Dataframe - iterrows for i, row in df.iterrows(): df.loc[i, 'a'] = 1 cnt = row['count']
[Python] python-docx - word ์ฝ๊ธฐ/ํŽธ์ง‘ ํ•˜๊ธฐ Demo.docx ํŒŒ์ผ์„ ์—ด์–ด์„œ ํŽธ์ง‘ํ•ด๋ณด๊ธฐ from docx import Document from docx.enum.table import WD_ALIGN_VERTICAL from docx.enum.text import WD_ALIGN_PARAGRAPH document = Document('Demo.docx') # ๋ฌธ์„œ๋‚ด์˜ ํ…Œ์ด๋ธ”๋“ค tables = document.tables # 1๋ฒˆ์งธ ํ…Œ์ด๋ธ” 0, 0 ์…€ - 2๋ฒˆ์งธ paragraphs์— ์ž…๋ ฅ tables[0].cell(0, 0).paragraphs[1].text = 'paragraphs[1]' # 2๋ฒˆ์งธ ํ…Œ์ด๋ธ” 0, 0 ์…€์— ์ž…๋ ฅ tables[1].cell(0, 0).text = 'table[1] (0,0)' out_file = 'New.docx' do..
[Python] openpyxl - ์—‘์…€ ์ฝ๊ธฐ/ํŽธ์ง‘ ํ•˜๊ธฐ
[Python] Pandas - Dataframe, NaN ๊ฐ’ ์ฒ˜๋ฆฌ ๊ฒฐ์ธก๊ฐ’ ์žˆ๋Š” ํ–‰ ์‚ญ์ œ (axis=1 ๋˜๋Š” column ์ด๋ผ๊ณ  ํ•˜๋ฉด ์ปฌ๋Ÿผ ์‚ญ์ œ) df = df.dropna(axis = 0) df = df.reset_index(drop=True) ํŠน์ • ์—ด ์กฐ๊ฑด ์ฃผ๊ธฐ df.dropna(subset=['score']) 0์œผ๋กœ ๋ฐ”๊พธ๊ธฐ # 1 df.fillna(0) # 2 df.replace(np.NaN, 0)