TypeError:只能执行标量值的操作

时间:2019-03-07 03:53:21

标签: python-3.x typeerror sklearn-pandas

如果您能让我知道如何为here提供的表格绘制一些信息图表,将不胜感激。

例如,对于名为“国内非上市公司:非上市公司使用IFRS”的列,我需要一个条形图,其中显示了在允许或禁止使用IFRS的管辖范围内,等等。或者,“审核报告指出符合IFRS”列的条形图。

此外,我需要一个饼图,其标题为“国内上市公司”,以显示允许或禁止使用IFRS的地区。

tables = pd.read_html('https://www.iasplus.com/en/resources/ifrs-topics/use-of-ifrs', header = None)

df = tables[2]

df.columns = df.columns.get_level_values(0)  + ":" + df.columns.get_level_values(1)

sns.countplot( "Domestic unlisted companies:Use of IFRSs by unlisted companies", data=df)

能否让我知道如何解决此错误?

  File "D:/mifs-master_2/MU/learning-from-imbalanced-classes-master/learning-from-imbalanced-classes-master/continuous/Final Logit/SMOTENC/logit-smotency - Copy (2).py", line 37, in <module>
    df.columns = df.columns.get_level_values(0)  + ":" + df.columns.get_level_values(1)
  File "C:\Users\Markazi.co\Anaconda3\lib\site-packages\pandas\core\indexes\base.py", line 3968, in _evaluate_numeric_binop
    other = self._validate_for_numeric_binop(other, op, opstr)
  File "C:\Users\Markazi.co\Anaconda3\lib\site-packages\pandas\core\indexes\base.py", line 3958, in _validate_for_numeric_binop
    raise TypeError("can only perform ops with scalar values")
TypeError: can only perform ops with scalar values

谢谢。

0 个答案:

没有答案