<Python으로 HDFS에 있는 csv파일을 읽어오는 예시>
import pandas as pd
from hdfs import InsecureClient # Python에서 hdfs를 사용하기 위한 모듈 import
client_hdfs = InsecureClient('http://localhost:9870') #namenode 의 웹 인터페이스
with client_hdfs.read('/user/csv/sample.csv') as reader :
df = pd.read_csv('reader,index_col=0)
print(df)
'Hadoop' 카테고리의 다른 글
Jupyter Notebook 저장 및 Linux 터미널로 실행(feat. Ubuntu) (1) | 2021.09.08 |
---|---|
Linux에 Jupyter Notebook 설치(feat.Ubuntu) (1) | 2021.09.08 |
Python에서 표준입력 받는 법(feat. Ubuntu) (0) | 2021.09.07 |
Python HDFS 사전 세팅 (0) | 2021.09.07 |
HDFS 명령어 (feat. Ubuntu) (0) | 2021.09.07 |
댓글