吴恩达机器学习ex3

    科技2025-06-06  12

    1.2数据可视化

    Module matplotlib.cm has no binary member

    Module matplotlib.cm has no binary member

    fig, ax_array = plt.subplots(nrows=10, ncols=10, sharey=True, sharex=True, figsize=(12, 12)) for r in range(10): for c in range(10): ax_array[r, c].matshow(np.array(sample_images[10 * r + c].reshape((20, 20))).T,cmap=matplotlib.cm.binary) plt.xticks(np.array([])) plt.yticks(np.array([]))

    显示

    { "resource": "/C:/Users/GYL/Desktop/Untitled-3.py", "owner": "python", "code": "no-member", "severity": 8, "message": "Module 'matplotlib.cm' has no 'binary' member", "source": "pylint", "startLineNumber": 19, "startColumn": 93, "endLineNumber": 19, "endColumn": 93 }

    改正:

    cmap='binary'
    Processed: 0.011, SQL: 8