Pandas와 친해지기(10분 Pandas) (2024-02-07)
Gotchas (2024-02-07)¶
# if pd.Series([False, True, False]):
# print("I was true")
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In[117], line 1 ----> 1 if pd.Series([False, True, False]): 2 print("I was true") File c:\Users\kssg1\AppData\Local\Programs\Python\Python38\lib\site-packages\pandas\core\generic.py:1466, in NDFrame.__nonzero__(self) 1464 @final 1465 def __nonzero__(self) -> NoReturn: -> 1466 raise ValueError( 1467 f"The truth value of a {type(self).__name__} is ambiguous. " 1468 "Use a.empty, a.bool(), a.item(), a.any() or a.all()." 1469 ) ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
{ "name": "ValueError", "message": "The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().", "stack": "--------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In[117], line 1 ----> 1 if pd.Series([False, True, False]): 2 print("I was true")
File c:\Users\kssg1\AppData\Local\Programs\Python\Python38\lib\site-packages\pandas\core\generic.py:1466, in NDFrame.nonzero(self) 1464 @final 1465 def nonzero(self) -> NoReturn: -> 1466 raise ValueError( 1467 f"The truth value of a {type(self).name} is ambiguous. " 1468 "Use a.empty, a.bool(), a.item(), a.any() or a.all()." 1469 )
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all()." }
이로써 한번 완독?완타가 끝났다¶
그래서 내일 부터는 10분 pandas에서 했던 내용중 좀더 자세히 알고 싶거나 헷깔리는 부분에 대해 좀 더 예제를 찾아서 따라쳐볼 예정이다