Pandas Error - Not able to pull in plotting tools like scatter_matrix

Pandas Error - Not able to pull in plotting tools like scatter_matrix
0.0 0

#1

I’m trying to troubleshoot the following error message:

File “iris.sheila.brown.py”, line 7, in
from pandas.plotting import scatter_matrix
ImportError: No module named plotting

The script I’m trying to run is:

from future import print_function
import pandas
import matplotlib
matplotlib.use(‘PDF’)
import matplotlib.pyplot as plt
from pandas.plotting import scatter_matrix
import matplotlib.pyplot as plt
from sklearn import model_selection
from sklearn.metrics import classification_report

Load libraries

from future import print_function
import pandas
import matplotlib
matplotlib.use(‘PDF’)
import matplotlib.pyplot as plt
from pandas.plotting import scatter_matrix
import matplotlib.pyplot as plt
from sklearn import model_selection
from sklearn.metrics import classification_report
from sklearn.metrics import confusion_matrix
from sklearn.metrics import accuracy_score
from sklearn.linear_model import LogisticRegression
from sklearn.tree import DecisionTreeClassifier
from sklearn.neighbors import KNeighborsClassifier
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
from sklearn.naive_bayes import GaussianNB
from sklearn.svm import SVC

print(“Sheila Brown - UTD\n”)

Check the versions of libraries

print(“LIBRARY VERSIONS:\n”)

Python version

import sys
print(‘Python: {}’.format(sys.version))

scipy

import scipy
print(‘scipy: {}’.format(scipy.version))

numpy

import numpy
print(‘numpy: {}’.format(numpy.version))

matplotlib

import matplotlib
print(‘matplotlib: {}’.format(matplotlib.version))

pandas

import pandas
print(‘pandas: {}’.format(pandas.version))

scikit-learn

import sklearn
print(‘sklearn: {}’.format(sklearn.version))

Load dataset

url = “iris(1).data”
dataset = pandas.read_csv(url, names=names)

shape

print("\nDATASET SHAPE =", dataset.shape,’\n’)

head

print(“FIRST 20 ROWS OF DATA =”,’\n’)
print(dataset.head(20),’\n’)


#2

Which version of Python you are using and where are you running these?