• 카테고리

    질문 & 답변
  • 세부 분야

    데이터 분석

  • 해결 여부

    미해결

Heatmap 오류

20.07.22 09:32 작성 조회수 532

1

안녕하세요? HeatMap 실행에서 다음과 같은 오류가 납니다. 해결을 위한 조언을 부탁합니다. 감사합니다. 

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-91-0878fd8b3426> in <module>
     23 
     24 
---> 25 HeatMap(heat).add_to(m)
     26 
     27 m.save('Heatmap.html')

C:\Anaconda\lib\site-packages\folium\plugins\heat_map.py in __init__(self, data, name, min_opacity, max_zoom, max_val, radius, blur, gradient, overlay, control, show, **kwargs)
     66         self.data = [[*validate_location(line[:2]), *line[2:]]  # noqa: E999
     67                      for line in data]
---> 68         if np.any(np.isnan(self.data)):
     69             raise ValueError('data may not contain NaNs.')
     70         self.options = parse_options(

TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''

답변 3

·

답변을 작성해보세요.

1

Neo님의 프로필

Neo

질문자

2020.07.22

heat = df_bread[["위도", "경도", "브랜드명"]].copy()

heat["브랜드명"] = heat["브랜드명"].replace("뚜레쥬르", 1).replace("파리바게뜨", 1)

heat = heat.values

에서 replace("파리바게트", 1)로  변경하니 작동합니다. 

0

Neo님의 프로필

Neo

질문자

2020.07.22

네. 감사합니다. 

0

안녕하세요. 

잘 해결되었다니 다행이네요.

뚜레쥬르와 파리바게뜨를 같은 값으로 채워주셨는데 의도하신것인지 궁금합니다.

올려주신 오류를 보니 isnan 을 지원하지 않는다는 메시지로 결측치가 섞여 있었던것 같습니다.

좋은하루 되세요!

감사합니다 :)