graph.write_pdf(“iris.pdf”) AttributeError: 'list' object has no attribute 'write_pdf'
My code is follow the class of machine learning of google.The two code are same.I don't know why it show error.May be the type of variable is error.But google's code is same to me.Who has ever had this problem? This is error [0 1 2] [0 1 2] Traceback (most recent call last): File "/media/joyce/oreo/python/machine_learn/VisualizingADecisionTree.py", line 34, in <module> graph.write_pdf("iris.pdf") AttributeError: 'list' object has no attribute 'write_pdf' [Finished in 0.4s with exit code 1] [shell_cmd: python -u "/media/joyce/oreo/python/machine_learn/VisualizingADecisionTree.py"] [dir: /media