import numpy as np import matplotlib.pyplot as plt # 读取数据 #data = np.array([19.57, 19.48, 19.61, 19.52, 19.42, 19.48, 19.37, 19.43, 19.51]) #data = np.array([47.2, 47.3, 47.283, 46.867, 47.167, 47.283]) data = np.array([1.61, 1.611, 1.611, 1.61, 1.611]) # 计算平均值和标准差 mean = np.mean(data) std = np.std(data) # 计算异常值阈值 threshold = mean + std down = mean - std # 绘制散点图 fig, ax = plt.subplots() ax.scatter(range(len(data)), data) # 标记异常值 outliers = [x for x in data if x > threshold or x