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


Python

(75)
ubuntu / jupyter lab / flutter flutter ์„ค์น˜sudo snap install flutter --classic  Install the Dart Kernel  https://github.com/vickumar1981/jupyter-dart-kernel GitHub - vickumar1981/jupyter-dart-kernel: Dart Kernel for Jupyter NotebooksDart Kernel for Jupyter Notebooks. Contribute to vickumar1981/jupyter-dart-kernel development by creating an account on GitHub.github.com > git clone https://github.com/vickumar1981/jupyter-dart-ker..
[Pandas] Dataframe ์ธ๋ฑ์Šค to list ๋ณ€ํ™˜ to_list() ์‚ฌ์šฉ >>> idx = pd.Index([1, 2, 3]) >>> idx Index([1, 2, 3], dtype='int64') >>> idx.to_list() [1, 2, 3] https://pandas.pydata.org/docs/reference/api/pandas.Index.tolist.html pandas.Index.tolist — pandas 2.1.1 documentation Return the array as an a.ndim-levels deep nested list of Python scalars. pandas.pydata.org
[Pandas] Dataframe ์ „์ฒด ์ถœ๋ ฅํ•˜๊ธฐ import numpy as np from sklearn.datasets import load_iris import pandas as pd # Loading irirs dataset data = load_iris() df = pd.DataFrame(data.data, columns = data.feature_names) display(df) import numpy as np from sklearn.datasets import load_iris import pandas as pd data = load_iris() df = pd.DataFrame(data.data, columns = data.feature_names) # The scope of these changes made to # pandas sett..
[Pandas] Dataframe ์†Œ์ˆ˜์  ๊ด€๋ จ pd.read_excel('d:/a.xlsx', dtype={'a': str}) read_excel ๋กœ 14.8, 14.3์„ ์ฝ์—ˆ๋Š”๋ฐ ์ด๋Ÿฐ์‹์œผ๋กœ ๋˜์–ด์„œ ๋ฐ˜์˜ฌ๋ฆผ์„ ํ•ด์ฃผ์—ˆ๋‹ค..
[Python] curve fitting ๋ฐ‘์ด ์ž์—ฐ์ƒ์ˆ˜ e์ธ ์ง€์ˆ˜ํ•จ์ˆ˜ x = np.arange(-2, 4, 0.1) y = np.exp(x) plt.plot(x, y, label='e^x') plt.legend() plt.show() ์ž์—ฐ๋กœ๊ทธ ํ•จ์ˆ˜ x = np.arange(0.1, 4, 0.1) y = np.log(x) plt.plot(x, y, label='y = log x') plt.legend() plt.show() ์ง€์ˆ˜ ํ•จ์ˆ˜ curve fitting from scipy.optimize import curve_fit import matplotlib.pyplot as plt # a*e^(-b*x)+c def func1(x, a, b, c): return a * np.exp(-b * x) + c def func2(x, a, b, c): ret..
[Python] jupyter ์—์„œ event loop ์˜ค๋ฅ˜ ๋‚  ๋•Œ ์ถ”๊ฐ€ import nest_asyncio nest_asyncio.apply() https://www.inflearn.com/questions/35032 ์ฃผํ”ผํ„ฐ ๋…ธํŠธ๋ถ์—์„œ ์‹ค์Šตํ•˜์‹œ๋Š” ๋ถ„๋“ค์€ ๋‹ค์Œ์„ ์ฐธ์กฐํ•˜์‹œ๋ฉด ์ข‹์Šต๋‹ˆ๋‹ค. - ์ธํ”„๋Ÿฐ | ์งˆ๋ฌธ & ๋‹ต๋ณ€ !pip install nest_asyncio import nest_asyncio nest_asyncio.apply() ์œ„์˜ ์ฝ”๋“œ๋ฅผ ์…€์— ์ถ”๊ฐ€ํ•ด์ฃผ์„ธ์š” ์ฃผํ”ผํ„ฐ ๋…ธํŠธ๋ถ์€ ์ž์ฒด์ ์œผ๋กœ ์ด๋ฒคํŠธ ๋ฃจํ”„๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ๊ณ  ์ด๋Ÿฌํ•œ ๋ฃจํ”„๋“ค์€ ์ค‘์ฒฉ๋˜์ง€ ์•Š๋Š”๋‹ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค. ์ฐธ์กฐ: www.inflearn.com
[Python] pywebview - webview ๋งŒ๋“ค๊ธฐ ์„ค์น˜ pip install pywebview Hello world: import webview webview.create_window('Hello world', 'https://pywebview.flowrl.com/') webview.start() HTML ๋ถˆ๋Ÿฌ์˜ค๊ธฐ url, html ๋‘˜ ๋‹ค ์žˆ์„ ๊ฒฝ์šฐ html ์ด ์šฐ์„  ์ˆœ์œ„๋ฅผ ๊ฐ€์ง„๋‹ค. import webview webview.create_window('Woah dude!', html='Woah dude!') webview.start() HTML ํŒŒ์ผ ๋ถˆ๋Ÿฌ์˜ค๊ธฐ import webview webview.create_window('Woah dude!', 'index.html') webview.start() HTTP server pywebview๋Š” WSGI ํ˜ธํ™˜..
[Python] pip ์„ค์น˜, ์—…๊ทธ๋ ˆ์ด๋“œ (Windows) pip ๋ฒ„์ „ ํ™•์ธ pip --version pip -V pip ์—…๊ทธ๋ ˆ์ด๋“œ python -m pip install --upgrade pip python -m ์—์„œ -m ์˜ ๋œป -m mod : run library module as a script (terminates option list) ๊ฒฝ๋กœ ์ถœ๋ ฅ python -m site Site Packages๊ฐ€ ์„ค์น˜๋˜์–ด ์žˆ๋Š” ๊ฒฝ๋กœ๋ฅผ ์ถœ๋ ฅํ•˜๋Š” ๋ฐฉ๋ฒ• python -m site --user-site pip๋กœ ์„ค์น˜ ๋ฐฉ๋ฒ• pip install flask # ๋ฒ„์ „ ์ง€์ • pip install flask==1.1.1 # ์—…๊ทธ๋ ˆ์ด๋“œ pip install -U flask pip install --upgrade flask pip install --force-reinstall flas..