Python (75) ์ธ๋ค์ผํ ๋ฆฌ์คํธํ [Python] Pandas - Dataframe, NaN ๊ฐฏ์ def cnt_nan(df): """์ ์ฒด ํ NaN ๊ฐฏ์ ์กฐํ :param pandas.DataFrame df: dataframe :return: dataframe Example: ๋ค์๊ณผ ๊ฐ์ด ์ฌ์ฉํ์ธ์: >>> cnt_nan(df) """ df_len = len(df) df = pd.DataFrame(df.isnull().sum()) df['%'] = (df[0]/df_len)*100 # ๋น์จ df = df.rename(columns = {0: 'NaN cnt'}) return df [Python] Pandas - Dataframe, json ์ผ๋ก ๋ณ๊ฒฝ import pandas as pd df = pd.DataFrame({'a':152.0054343543, 'b':0.0070054423423, 'c':-7.54543543E-07, 'd':2.50282237391414E-11}, index=[0]) df.to_json(orient='records', double_precision=15) - to_json ์ด์ฉ - ์์ซ์ ์๋ฆฌ์ ๊ธฐ๋ณธ 10์๋ฆฌ๋ผ์ 15๋ก ์ค์ ํจ date_format https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.to_json.html pandas.DataFrame.to_json — pandas 1.1.0 documentation The time unit.. [Python] Pandas - Dataframe ์ ์ฒด ํ, ์ด ๋ณด๊ธฐ ์ค์ pd.set_option('display.max_columns', None) pd.set_option('display.max_rows', None) [Python] Pandas - dataframe์ ํน์ ๊ฐ์ NaN์ผ๋ก ๋ณ๊ฒฝ 0์ NaN์ผ๋ก ๋ณ๊ฒฝ import numpy as np df = df.replace(0, np.NaN) [jupyter] Terminal ์์ ๊ธฐ jupyter_notebook_config.py c.NotebookApp.terminals_enabled = False Streamlit. The fastest way to build custom ML tools https://www.streamlit.io/ Streamlit — The fastest way to build custom ML tools Streamlit is an open-source app framework for Machine Learning and Data Science teams. Create beautiful data apps in hours, not weeks. All in pure Python. All for free. www.streamlit.io [Python] Pandas - Dataframe ์ปฌ๋ผ๋ช ์กฐํ df.columns # Import pandas package import pandas as pd df = pd.read_csv("a.csv") # iterating the columns for col in df.columns: print(col) [Python] __name__ __name__ - ํ์ด์ฌ ์์ฒด์์ ์ฌ์ฉํ๋ ๋ณ์ - ์ง์ ์คํ ๋ ๊ฒฝ์ฐ๋ __name__ = __main__ - ๋ค๋ฅธ ํ์ผ์ ์ํฌํธ ๋ ๊ฒฝ์ฐ๋ ์์ ์ ํ์ผ๋ช ์ด ๋ฐ์ธ๋ฉ๋จ # ์ง์ ์คํํ ๊ฒฝ์ฐ๋ง ์คํ if __name__ == "__main__": print(__name__) ์ด์ 1 ยทยทยท 5 6 7 8 9 10 ๋ค์ ํฐ์คํ ๋ฆฌํด๋ฐ Developer๐ค๊ตฌ๋ ํ๊ธฐ