실행 결과

    <class 'pandas.core.frame.DataFrame'>
    Int64Index: 377756 entries, 21 to 492043
    Data columns (total 7 columns):
     #   Column    Non-Null Count   Dtype         
    ---  ------    --------------   -----         
     0   start     377756 non-null  datetime64[ns]
     1   end       377756 non-null  datetime64[ns]
     2   answered  377756 non-null  int64         
     3   votes     377756 non-null  int64         
     4   category  377756 non-null  object        
     5   title     377756 non-null  object        
     6   content   377755 non-null  object        
    dtypes: datetime64[ns](2), int64(2), object(3)

     

    이번에는 데이터를 살펴보자. 전체 데이터를 모두 읽으면 내용이 너무 많기 때문에 일부 데이터만 살펴보겠다. head()로 처음 데이터 5개를 읽어온다. 국민청원의 고유번호(article_id), 타이틀(title), 청원 내용(context), 청와대에서 답변했는지 여부(answer)를 볼 수 있다.

    petitions.head()
    신간 소식 구독하기
    뉴스레터에 가입하시고 이메일로 신간 소식을 받아 보세요.