#!/usr/bin/env python3
"""Specificity"""
import numpy as np


def specificity(confusion):
    """Function that calculates the specificity for each class
    in a confusion matrix"""
    TP = np.diag(confusion)
    FP = np.sum(confusion, axis=0) - TP
    TN = []
    for i in range(len(confusion)):
        temp = np.delete(confusion, i, 0)
        temp = np.delete(temp, i, 1)
        TN.append(sum(sum(temp)))

    specificity = TN / (TN + FP)
    return specificity

f9b9b6f1b11f3e32b9c3e36f5fdf106c40cfc44b
<mask token>

<mask token>


def specificity(confusion):
    """Function that calculates the specificity for each class
    in a confusion matrix"""
    TP = np.diag(confusion)
    FP = np.sum(confusion, axis=0) - TP
    TN = []
    for i in range(len(confusion)):
        temp = np.delete(confusion, i, 0)
        temp = np.delete(temp, i, 1)
        TN.append(sum(sum(temp)))
    specificity = TN / (TN + FP)
    return specificity

<mask token>
import numpy as np


def specificity(confusion):
    """Function that calculates the specificity for each class
    in a confusion matrix"""
    TP = np.diag(confusion)
    FP = np.sum(confusion, axis=0) - TP
    TN = []
    for i in range(len(confusion)):
        temp = np.delete(confusion, i, 0)
        temp = np.delete(temp, i, 1)
        TN.append(sum(sum(temp)))
    specificity = TN / (TN + FP)
    return specificity

#!/usr/bin/env python3
"""Specificity"""
import numpy as np


def specificity(confusion):
    """Function that calculates the specificity for each class
    in a confusion matrix"""
    TP = np.diag(confusion)
    FP = np.sum(confusion, axis=0) - TP
    TN = []
    for i in range(len(confusion)):
        temp = np.delete(confusion, i, 0)
        temp = np.delete(temp, i, 1)
        TN.append(sum(sum(temp)))

    specificity = TN / (TN + FP)
    return specificity
