Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.9k views
in Technique[技术] by (71.8m points)

arrays - What should i do with this error in python?

i write this code in python

def RangeSubjektif (_low, _high, _step):
    subjektif = np.arange(_low, _high, _step)
    return subjektif

def AlgoritmaFuzzyAge(_rule, _range_subjektif, _title):
    mi = fuzz.trimf(_range_subjektif, _rule[0])
    hi = fuzz.trimf(_range_subjektif, _rule[1])
    
    fig, ax = plt.subplots(nrows=1, figsize=(6, 3))
    ax.plot(_range_subjektif, mi, 'g', linewidth=1.5, label = "Low Risk")
    ax.plot(_range_subjektif, hi, 'r', linewidth=1.5, label = "High Risk")
    
    ax. set_title(_title)
    ax.legend()
    
    ax.spines['top'].set_visible(False)
    ax.spines['right'].set_visible(False)
    ax.get_xaxis().tick_bottom()
    ax.get_yaxis().tick_left()
    
    plt.tight_layout()
    plt.show()
    
    return mi, hi

minage = min(data_age)
maxage = max(data_age)
miage = minage
maage = maxage
xage = RangeSubjektif(minage, maxage, 1)
rage = np.array([
    [0, minage, maxage],
    [minage, maxage, maxage]
])

mi_age, hi_age = AlgoritmaFuzzyAge(rage, xage, 'Umur')

but the result of this code show this error: :6: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray rage = np.array([ what is that mean? and what should i do to remove that warning??


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...