-2
ax.set_xlabel(var)
ax.set_ylabel('Density')
ax.legend_.remove()

#Format the plot

plt.suptitle('Observation Compared to Test Distribution', y = 1.02, size = 20)
  plt.tight_layout()
  plt.show()

Format the plot

 plt.suptitle('Observation Compared to Test Distribution', y = 1.02, size = 20)
  plt.tight_layout()
  plt.show()


***ERROR***
AttributeError                            Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_2372/995712697.py in <module>
      3 
      4 test_index = 5
----> 5 investigate_obs(trace_log, X_test.iloc[test_index, :], y_test.values[test_index])

~\AppData\Local\Temp/ipykernel_2372/214169725.py in investigate_obs(trace, obs, true_label, examine_pred)
     52           ax.set_xlabel(var)
     53           ax.set_ylabel('Density')
---> 54           ax.legend_.remove()
     55 
     56       # Format the plot

AttributeError: 'NoneType' object has no attribute 'remove'

1 Answers1

-1

According to me you are using a module which don't have any function called "remove".

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 14 '22 at 16:48