seaborn.histplot显示在文档中,但给出了AttributeError

2024-05-15 21:35:30 发布

您现在位置:Python中文网/ 问答频道 /正文

这是我的密码:

import pandas as pd
import numpy as np

import matplotlib.pyplot as plt

import seaborn as sb


df = pd.read_csv("insurance.csv")

sb.histplot(df.charges)

运行代码时,出现以下错误:

AttributeError Traceback (most recent call last) in ----> 1 sb.histplot(df.charges)

AttributeError: module 'seaborn' has no attribute 'histplot'


Tags: csvimportnumpy密码pandasdfmatplotlibas