Installing Apache Spark Installing Apache Spark and Python Windows: (keep scrolling for MacOS and Linux) Install a JDK (Java Development Kit) from http://www.oracle.com/technetwork/java/javase/downloads/index.html . You must install the JDK into a path with no spaces, for example c:\jdk. Be sure to change the default location for the installation! DO NOT INSTALL JAVA 16. SPARK IS ONLY COMPATIBLE WITH JAVA 8 OR 11. Down.. 2023. 2. 16. [Airflow] Remove DAG examples DAG 예시 파일 제거 방법 Remove DAG examples To keep our Airflow instance nice and clean, we are going to remove the DAG examples from the UI To do this Open the file docker-compose.yaml Replace the value 'true' by 'false' for the AIRFLOW__CORE__LOAD_EXAMPLES environment variables Save the file Restart Airflow by typing docker-compose down && docker-compose up -d Once it's done, go back to localhost:8080 and you should .. 2023. 1. 24. [Airflow]. Airflow Local Executor와 Celery Executor Executor Executor란 ? Airflow에서 이야기하는 Executor은 task가 실행되는 매커니즘으로 Executor을 어떻게 설정하느냐에 따라 task 실행방식이 달라집니다. Airflow에서 제공하는 전체 Executor은 아래의 링크에서 확인할 수 있습니다. https://airflow.apache.org/docs/apache-airflow/stable/executor/index.html https://airflow.apache.org/docs/apache-airflow/stable/executor/index.html airflow.apache.org Sequential Executor Sequential Executor은 Airflow에서 제공하는 기본 Executor입니다. sql.. 2023. 1. 23. [Airflow] 기본 정리 Apache Airflow의 장점 Python 기반 데이터 분석을 하는 분들도 쉽게 코드를 작성할 수 있음 Scheduling : 특정 간격으로 계속 실행 Airflow 콘솔이 따로 존재해 Task 관리를 서버에서 들어가 관리하지 않아도 됨 각 작업별 시간이 나오기 때문에 bottleneck을 찾을 때에도 유용함 Backfill : 과거 작업 실행 캐치업 Catch up -> 그동안 밀린거 다 실행할건지 여부 / True - YES! 특정 Task 실패시 => Task만 재실행 / DAG 재실행 등 실패 로직도 있음 데이터 엔지니어링에서 많이 사용됨 Google Cloud Platform에 있는 대부분의 기능을 지원 Google Cloud Platform엔 Managed Service(관리형 서비스)인 .. 2023. 1. 23. [Pandas] 조건걸고 새로운 칼럼 추가하기 https://data-newbie.tistory.com/559 [Pandas] 조건걸고 새로운 컬럼 추가하기 https://signing.tistory.com/55#comment5838430 [Tips] 조건걸고 새로운 컬럼 추가하기 in Pandas DataFrame R에서는 대부분의 핸들링을 자유롭게 하던 나는 파이썬으로 그 작업들을 하나씩 진행하고자 한다. 분.. data-newbie.tistory.com 기존 signing님의 방법 (List Comprehension) iris['new_column'] = ['Large' if t else 'Small' for t in list(iris['Sepal.Length'] > 4)] 사전을 활용하여 값 변환해주기 iris = sns.load_data.. 2023. 1. 7. [Airflow] The important views of the Airflow UI DAGs Page DAG는 Directed Acyclic Graph의 약자로 Airflow에선 workflow라고 설명함 Task의 집합체 메인 화면엔 정의되어 있는 DAG들을 확인할 수 있음 현재는 많은 example이 존재 example을 보고싶지 않다면 airflow.cfg에서 load_examples = False로 설정하면 됨 Running Switch DAG Pause/Unpause 버튼을 통해 DAG 활성화 및 비활성화 가능 Name & Tags DAG Name & Tag example_short_circuit_operator이라는 dag name이고, example이라는 tag가 있다. tag를 통해 DAG 검색이 가능하므로 프로젝트별 기능별로 나누면 좋을 거 같다. Owne.. 2023. 1. 7. [Python] 대용량 데이터csv 읽어오기 (PyArrow) pyarrow 아파치 애로우(Apache Arrow)라는 메모리 내 분석을 위한 개발 플랫폼인데, 빅데이터를 빠르게 처리하고 이동할 수 있도록 하는 일련의 기술을 제공하는 라이브러리를 파이썬 PyArrow를 통해 구현할 수 있다. 기존의 pandas로 용량이 큰 csv파일을 로드하면 시간이 오래 걸리는데, pyarrow를 활용하면 시간 절약에 도움이 된다. https://pypi.org/project/pyarrow/ pyarrow Python library for Apache Arrow pypi.org 공식 문서는 여기있다. Across platforms, you can install a recent version of pyarrow with the conda package manager: con.. 2023. 1. 7. [python] 서울시전월세_매물_위도,경도_구하기_GoogleMapAPI 서울시전월세_매물_위도,경도_구하기_GoogleMapAPI 자 구글 드라이브 임포트 해주고 절대 GCP써서 구글드라이브로 불러오는건 아닙니다. In [3]: from google.colab import drive drive.mount('/content/drive') 결과 : Mounted at /content/drive 구글맵스 깔아주고 In [24]: !pip install googlemaps OUT Collecting googlemaps Downloading googlemaps-4.6.0.tar.gz (31 kB) Requirement already satisfied: requests=2.20.0 in /usr/local/lib/python3.7/dist-packages (from googlemaps.. 2023. 1. 6. [Python] Pandas: 한 셀의 데이터를 여러 행으로 나누기 https://ohgyun.com/768 Pandas: 한 셀의 데이터를 여러 행으로 나누기 df = pd.DataFrame({'foo': ['a,b,c,d,e', 'd,e,f', 'h,i']}) df 위와 같이 한 셀에 들어있는 문자열을 컴마로 구분해서 한 글자씩 여러 행으로 나누고 싶다. 해결책: 문자열을 split 해 각 행을 여러 컬럼으로 나눈 후 병합하는 방법으로 구현할 수 있다. 먼저, 각 foo 컬럼의 문자열을 배열로 나눈다. split = df.foo.str.split(',') split 각 배열이 Series를 리턴하게 apply를 적용하면, Series -> DataFrame으로 변환할 수 있다. split = split.apply(lambda x: pd.Series(x)) split .. 2023. 1. 6. [Python] Python에서 youtube 불러오기 from IPython.display import YouTubeVideo YouTubeVideo('url주소 뒷자리 ', width=600, height=400) 600 400은 크기 YouTubeVideo 라이브러리를 사용한다. 2023. 1. 6. 이전 1 2 다음 반응형