def bins_poorstats(data, nbins, ndata, threshold_percent=1.0):
    """
    Get Percentage of total bins which are poorly populated

    Parameters
    ----------
    data : numpy.ndarray[int, ndim=1]
        A numpy array holding observed frequencies of bins used for histogram
    nbins : int
        number of bins
    ndata : int
        Number of sample points to be histogrammed.
    threshold_percent : float 
        A float value in an open interval(0.0, 100.0) bins with occupancy(%)
        below which will be labelled blank(poorly-populated). Here, it is 
        assumed that sample-data is from uniform distribution, and thershold
        is percent-thresold of expected occupancy.

        e.g. If data has 1000000 sample points, hisstogrammed with 200 bins, 
        then with 1.0% thershold value. bins having less-than 
        (1.0/100.0) * (1000000 / 50.0) i.e. 50 samples will be considered
        poorly populated, if it comes less than 2 then minimum observed freq is 
        considered 2.

    Returns
    -------
    float 
        A value in an open interval(0.0, 100.0) representing percentage of 
        total bins labeled blank(poorly-populated)

    """
    min_count = threshold_percent * ndata / (100 * nbins)
    min_count = 2 if min_count < 2 else min_count
    n_almost_blanks = len(data[data <= min_count])
    res = round(n_almost_blanks * 100.0 / nbins, 1)
    return res