TypeError: The numpy boolean negative, the `-` operator, is not supported, use the `~`

  • error
    • Traceback (most recent call last):
        File "C:/Users/Administrator/Desktop/pc/2018031800/jiaoyou2.py", line 8, in <module>
          print source
        File "D:\python2.7\lib\site-packages\pandas\core\base.py", line 35, in __str__
          return self.__bytes__()
        File "D:\python2.7\lib\site-packages\pandas\core\base.py", line 47, in __bytes__
          return self.__unicode__().encode(encoding, 'replace')
        File "D:\python2.7\lib\site-packages\pandas\core\frame.py", line 460, in __unicode__
          line_width=width, show_dimensions=show_dimensions)
        File "D:\python2.7\lib\site-packages\pandas\core\frame.py", line 1299, in to_string
          formatter.to_string()
        File "D:\python2.7\lib\site-packages\pandas\core\format.py", line 380, in to_string
          strcols = self._to_str_columns()
        File "D:\python2.7\lib\site-packages\pandas\core\format.py", line 329, in _to_str_columns
          fmt_values = self._format_col(i)
        File "D:\python2.7\lib\site-packages\pandas\core\format.py", line 501, in _format_col
          space=self.col_space
        File "D:\python2.7\lib\site-packages\pandas\core\format.py", line 1626, in format_array
          return fmt_obj.get_result()
        File "D:\python2.7\lib\site-packages\pandas\core\format.py", line 1642, in get_result
          fmt_values = self._format_strings()
        File "D:\python2.7\lib\site-packages\pandas\core\format.py", line 1670, in _format_strings
          is_float = lib.map_infer(vals, com.is_float) & notnull(vals)
        File "D:\python2.7\lib\site-packages\pandas\core\common.py", line 276, in notnull
          return -res
      TypeError: The numpy boolean negative, the `-` operator, is not supported, use the `~` operator or the logical_not function instead.
  • 解决办法:
    •   File "D:\python2.7\lib\site-packages\pandas\core\common.py", line 276, in notnull
          return -res
    • common.py进入这个文件将“return -res”改成“return ~res”

                    

猜你喜欢

转载自my.oschina.net/u/3298130/blog/1645046