Google Apps Script 기본문법 - 2

조건문 if 조건문 코드는 아래와 같음 여러개의 조건문은 && 연산자 또는 || 연산자를 사용한다. function myFunction_01() { let number=9; if(number > 10) { console.log("큰 수입니다!") } else { console.log("작은 수입니다.") } } function myFunction_02() { var currentTemperature = 25; var isWeekend = true; var thresholdTemperature = 35; if (currentTemperature > thresholdTemperature && !isWeekend) { console.log("집에 계세요!") } else if (currentTemperature > thresholdTemperature || isWeekend) { console.log("외출하세요!") } else { console.log("판단을 보류합니다!

Google Apps Script 기본문법 - 1

개요 Google Apps Script의 기본문법을 배우도록 한다. 변수와 상수, 배열, 객체등을 테스트 한다. 자바스크립트 기초 기초 문법을 배우도록 한다. 아래와 같이 코드 생성 후 실행을 한다. function myFunction() { Logger.log("Hello World"); } 여러 함수를 만들고 선택적으로 실행이 가능하다. 주석 처리는 크게 // /* */ 으로 할 수 있다. function myFunction01_1() { Logger.log("Hello World"); } function myFunction01_2() { console.log("Hello GAS!") // 주석 입력 /* 여러 행에 걸쳐 주석을 입력한다. */ } 스크립트 편집기에서는 [Ctrl] + [/] 를 이용하면 주석처리가 가능하다.

M1 환경설정 XGBoost & LightGBM with Streamlit in Python

개요 M1에서 Python 환경설정을 해본다. XGBoost & LightGBM 및 Streamlit 설치를 진행한다. 아나콘다 설치 m1 버전의 아나콘다를 설치한다. 깃헙 레포 생성 먼저 github repo를 생성한다. Conda 가상환경 설정 git clone 명령어를 통해 repo를 로컬로 다운로드 한다. evan$ git clone https://github.com/yourname/m1_streamlit.git Cloning into 'm1_streamlit'... remote: Enumerating objects: 4, done. remote: Counting objects: 100% (4/4), done. remote: Compressing objects: 100% (3/3), done. remote: Total 4 (delta 0), reused 0 (delta 0), pack-reused 0 Receiving objects: 100% (4/4), done.

Kaggle - Colab API 연동

개요 API 토큰을 내려받은 후, 구글 코랩에서 데이터를 다운로드 받도록 한다. API 토큰 발급 Kaggle Profile - Settings - API를 순차적으로 클릭 후, Create New Token 버튼을 클릭한다. 아래 화면처럼 다운로드를 받을 수 있다. Google Colab API 코드 업로드 이제 해당 파일을 바탕화면 등 적당한 곳에 위치시킨 후 아래 코드를 실행한다. # kaggle.json 파일을 업로드하세요. from google.colab import files files.upload() 마지막으로 ~/.kaggle 폴더를 만들고 키 파일을 복사한 후, 보안을 위해 현재 사용자만 이 파일을 읽을 수 있도록 하는 명령어(chmod 600)를 실행한다.

Google Colab Plotly Graph 안 보일 때

현상 plotly 라이브러리를 활용하여 Google Colab에서 시각화를 할 때 그래프가 보이지 않는 현상이 존재함 여러 방법론이 등장하지만, 공식문서에 따라서 어떻게 활용하는지 확인하도록 함 Google Colab 먼저 구글 코랩에서 간단한 시각화 코드를 작성하고 코드를 실행한다. import plotly plotly.__version__ # 5.13.1 샘플 코드는 아래와 같음 import plotly.graph_objects as go import pandas as pd temp = pd.DataFrame({ "Fruit": ["Apples", "Oranges", "Bananas", "Apples", "Oranges", "Bananas"], "Contestant": ["Alex", "Alex", "Alex", "Jordan", "Jordan", "Jordan"], "Number Eaten": [2, 1, 3, 1, 3, 2], }) fig = go.

Scrapy Tutorial - 다중페이지 크롤링

개요 이번에는 Scrapy를 통해서 다중 페이지를 크롤링 하도록 한다. Target 페이지 타겟 웹사이트 : https://www.audible.com/search 프로젝트 시작 프로젝트 시작은 다음과 같이 할 수 있다. $ scrapy startproject multiCam_tutorial New Scrapy project 'multiCam_tutorial', using template directory 'C:\Users\j2hoo\OneDrive\Desktop\your_project_folder\venv\Lib\site-packages\scrapy\templates\project', created in: C:\Users\j2hoo\OneDrive\Desktop\your_path\multiCam_tutorial You can start your first spider with: cd multiCam_tutorial scrapy genspider example example.com 해당 multiCam_tutorial 경로에서 다음 명령어를 실행하여 타겟 사이트를 설정한다. $ scrapy genspider audible www.audible.com/search Created spider 'audible' using template 'basic' in module: multiCam_tutorial.

Scrapy Tutorial - 기본편

개요 Scrapy Tutorial 설치 과정 및 기본 크롤링 과정을 살펴본다. 라이브러리 설치 라이브러리 설치는 다음과 같다. pip install scrapy 프로젝트 시작 Django와 비슷하게 터미널 명령어는 startproject라고 입력한다. $ scrapy startproject multiCam_tutorial New Scrapy project 'multiCam_tutorial', using template directory 'C:\Users\j2hoo\OneDrive\Desktop\your_project_folder\venv\Lib\site-packages\scrapy\templates\project', created in: C:\Users\j2hoo\OneDrive\Desktop\your_path\multiCam_tutorial You can start your first spider with: cd multiCam_tutorial scrapy genspider example example.com 파일 구조는 아래와 같이 여러개의 파일로 구성되었다. 타겟 주소는 아래와 같다. 주소 : https://www.worldometers.info/world-population/population-by-country/ $ scrapy genspider worldometer www.

Django - ExcelCalCulator_7

개요 Django 한 그릇 뚝딱 교재의 내용에서 멀티캠퍼스 강의에 맞게 일부 수정함 2019년 버전이고 현재는 2023년이기 때문에 소스코드 변경 사항이 필요할 거 같아서 글을 남김 교재 홍보 교재 구매 : https://www.yes24.com/Product/Goods/83568594 Step 01 - 이전 글 1편 : https://dschloe.github.io/python/2023/08/django_excel_calculator_1/ 2편 : https://dschloe.github.io/python/2023/08/django_excel_calculator_2/ 3편 : https://dschloe.github.io/python/2023/08/django_excel_calculator_3/ 4편 : https://dschloe.github.io/python/2023/08/django_excel_calculator_4/ 5편 : https://dschloe.github.io/python/2023/08/django_excel_calculator_5/ 6편 : https://dschloe.github.io/python/2023/08/django_excel_calculator_6/ Step 02 - 프로젝트 완성하기 지금까지 구현한 기능과 미완료된 기능을 확인한다. Step 03 - 로그인 실패 시 보이는 화면을 구현 우선 사용자가 로그인 실패 시, 보이는 화면으로 구현한다.

Django - ExcelCalCulator_6

개요 Django 한 그릇 뚝딱 교재의 내용에서 멀티캠퍼스 강의에 맞게 일부 수정함 2019년 버전이고 현재는 2023년이기 때문에 소스코드 변경 사항이 필요할 거 같아서 글을 남김 교재 홍보 교재 구매 : https://www.yes24.com/Product/Goods/83568594 Step 01 - 이전 글 1편 : https://dschloe.github.io/python/2023/08/django_excel_calculator_1/ 2편 : https://dschloe.github.io/python/2023/08/django_excel_calculator_2/ 3편 : https://dschloe.github.io/python/2023/08/django_excel_calculator_3/ 4편 : https://dschloe.github.io/python/2023/08/django_excel_calculator_4/ 5편 : https://dschloe.github.io/python/2023/08/django_excel_calculator_5/ Step 02 - 프로젝트 완성하기 지금까지 구현한 기능과 미완료된 기능을 확인한다. Step 03 - 엑셀 결과 화면 출력 위한 세션값 저장 우선 calculate 함수의 마지막에 엑셀 결과 화면으로 데이터와 함께 url을 이동시켜본다.

Django - ExcelCalCulator_5

개요 Django 한 그릇 뚝딱 교재의 내용에서 멀티캠퍼스 강의에 맞게 일부 수정함 2019년 버전이고 현재는 2023년이기 때문에 소스코드 변경 사항이 필요할 거 같아서 글을 남김 교재 홍보 교재 구매 : https://www.yes24.com/Product/Goods/83568594 Step 01 - 이전 글 1편 : https://dschloe.github.io/python/2023/08/django_excel_calculator_1/ 2편 : https://dschloe.github.io/python/2023/08/django_excel_calculator_2/ 3편 : https://dschloe.github.io/python/2023/08/django_excel_calculator_3/ 4편 : https://dschloe.github.io/python/2023/08/django_excel_calculator_4/ Step 02 - 파일 업로드 하기 로그인을 통해 메인 화면으로 왔다면, 파일 업로드 기능 구현 Step 03 - 파일 업로드 기능 구현 check - 1 : index.