📊 𝗕𝗶𝗴𝗗𝗮𝘁𝗮

    [ML] tensorflow set_random_seed() 오류

    https://www.kaggle.com/code/dimitreoliveira/deep-learning-for-time-series-forecasting Deep Learning for Time Series Forecasting Explore and run machine learning code with Kaggle Notebooks | Using data from multiple data sources www.kaggle.com 위 캐글 노트북 필사를 하려고 하는데 하나 함수가 사용이 안됩니다. 보니까 tensorflow v1 api 라서 그런 것 같더라구요. 해당 오류를 해결해보도록 하겠습니다. 에러 확인 from tensorflow import set_random_seed set_random_see..

    [ML] 아나콘다 Tensorflow, Keras 설치하기 + kernel 에러 해결

    https://www.kaggle.com/code/dimitreoliveira/deep-learning-for-time-series-forecasting Deep Learning for Time Series Forecasting Explore and run machine learning code with Kaggle Notebooks | Using data from multiple data sources www.kaggle.com 해당 캐글 노트북 필사를 진행하려고 하는데 커널이 죽더라구요. kernel died 에러 해결하면서 tensorflow, keras 설치 포스팅도 겸사겸사 올려보겠습니다. 에러 확인 캐글 노트북 필사를 하려고 하는데 다음과 같은 에러가 발생합니다. The Kernel crash..

    [Plotly] 추이 비교 Multiple Bar 그래프 그리기

    추이 그래프 만들기 데이터를 다룰 때, 단위가 다른 두 그래프의 추이를 확인하고 싶을 때가 있습니다. plotly의 make_subplots() 를 이용하면 됩니다. + plotly 그래프에서 특정 값만 표시하거나 색상을 달리하고 싶을 때 사용하는 코드도 같이 있습니다. 참고 document 의 페이지 주소는 다음과 같습니다. https://plotly.com/python/multiple-axes/ Multiple Detailed examples of Multiple Axes including changing color, size, log axes, and more in Python. plotly.com # 특정 값만 색으로 포인트를 주기 위해서 리스트를 만듭니다. bg_colors = ['#ef553b..

    [Pandas] mode 최빈값 구하기

    최빈값 구하기 만약 다음과 같은 값이 있다고 합니다. 여기서 범주형 데이터 최빈값을 꺼내보려고 합니다. air_gd.groupby(by=['시도명', '항목'])[['19년_등급']].agg(pd.Series.mode) agg() 함수를 이용해서 pd.Series.mode 를 이용하면 됩니다. 그러면 다음과 같이 나오게 됩니다. 범주형 최빈값 구하기 pandas category mode group

    [Folium] JSON 지도 위에 텍스트 넣기

    folium을 이용해서 text 를 띄워보도록 하겠습니다. 여느 marker를 찍듯이 쉽게 사용할 수 있습니다. folium 설치 pip install folium 우선 folium 을 설치해줍니다. import folium from folium.features import DivIcon 그리고 import 로 가져와봅시다. 사용 데이터 기술통계 데이터로 사용할 2022년 전국 인구수 데이터 파일입니다. 대한민국 행정구 기준 경계선 geo json 파일 입니다. map 만들기 m = folium.Map(location=[35.8, 128.071503], zoom_start=7,) 우선 folium.Map() 을 만들어서 openstreetmap 을 띄우는 지도맵을 만들어줍니다. location 에는 위치..

    [Folium] html to png 이미지 파일로 저장하기

    Html to Png Folium 으로 맵을 만들고 나서 보면 html 파일로만 저장을 할 수가 있습니다. 하지만 보고서를 작성할 때 이미지가 필요한데 이때 일일이 캡쳐하기란 지루한 작업입니다. conda install -c conda-forge pyppeteer 혹은 pip install pyppeteer 이미지 파일로 저장하기 위해서 우선 pyppeteer 을 설치하셔야 합니다. from folium import utilities from pyppeteer import launch # 만든 지도를 png 파일로 캡쳐해서 저장하는 함수 async def map_to_png(target, m): html = m.get_root().render() browser = await launch(headless=..