0
나는 mooc을 복용하고 있습니다.pyspark.sql 구문과 함수의 차이를 이해하고 폭발 및 균열
는 그것은 텍스트
word |
+-------------------------------------------------+
|1609 |
| |
|the sonnets |
| |
|by william shakespeare |
| |
| |
| |
|1 |
|from fairest creatures we desire increase |
|that thereby beautys rose might never die |
|but as the riper should by time decease |
|his tender heir might bear his memory |
|but thou contracted to thine own bright eyes |
|feedst thy lights flame with selfsubstantial fuel|
+-------------------------------------------------+
아래에있는 shakespeareDF의 dataframe을 가지고, 그들은 코드
from pyspark.sql.functions import split, explode
shakeWordsDF = (shakespeareDF.select(explode(split(shakespeareDF[0],"\s+"))
아래 실행 이해하고 싶습니다 :
- 의 차이 무엇인가 폭발하고 분할 왜 우리는 둘 다 사용해야합니까? 나는 온라인 문서로보고 노력하고 이유는
shakespeareDF가 1 열 밖에 없다면 shakespeareDF [0]을 사용해야합니까? – user2543622
shakespeareDF는 Dataframe ..이며 필요한 것은 컬럼입니다. 컬럼 이름 shakespeareDF [ 'Column_Name']을 명시 적으로 지정하여 해당 컬럼을 선택할 수 있습니다. 또는이 경우 첫 번째 (및 유일한) 열이기 때문에 열 인덱스 .. 0을 사용하십시오. –