TypeError: can only perform ops with scalar values

一曲冷凌霜 提交于 2019-12-11 11:59:15

问题


I would appreciate if you could let me know how to plot some informative charts for the table provided here.

For example, I need a bar chart for the column named "Domestic unlisted companies:Use of IFRSs by unlisted companies" which shows in how many jurisdictions IFRSs is permitted, not permitted and so on. Or, a bar chart for the "Audit report states compliance with IFRS" column.

Besides, I need a pie chart for the column with the title "Domestic listed companies" which shows in how many jurisdictions IFRSs is permitted, not permitted and so on.

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)

Could you please let me know how to resolve this error?

  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

Thanks in advance.

来源:https://stackoverflow.com/questions/55035784/typeerror-can-only-perform-ops-with-scalar-values

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!