This is my code

import pandas as pd from sklearn.model_selection import KFold, cross_val_score from sklearn.neighbors import KNeighborsClassifier from sklearn.preprocessing import scale import numpy as np data = pd.read_csv('wine.data.txt', names = ['Class', 'Alcohol', 'Malic acid', 'Ash', 'Alcalinity of ash', 'Magnesium', 'Total phenols', 'Flavanoids', 'Nonflavanoid phenols', 'Proanthocyanins', 'Color intensity', 'Hue','OD280/OD315 of diluted wines', 'Proline']) X = data.values[::, 1:14] y = data.loc[:,'Class'] kf = KFold(n_splits = 5, shuffle = True, random_state = 42) scores = list() for k in range(1, 51): clf = KNeighborsClassifier(n_neighbors = k) scores.append(cross_val_score(clf, X, y, scoring = 'accuracy', cv = kf).mean()) scores2 = pd.Series(scores, index = range(1,51)) scl = pd.Dataframe(data = scale(X)) scl.to_excel('pandas.xlsx') 

This error appears

AttributeError: module 'pandas' has no attribute 'Dataframe'

Although the Series does not swear

Closed due to the fact that off-topic participants Twiss , MaxU , 0xdb , Kosta B. , ThisMan 7 Aug '18 at 14:31 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • "The question is caused by a problem that is no longer reproduced or typed . Although similar questions may be relevant on this site, solving this question is unlikely to help future visitors. You can usually avoid similar questions by writing and researching a minimum program to reproduce the problem before publishing the question. " - Twiss, MaxU, 0xdb, Kosta B., ThisMan
If the question can be reformulated according to the rules set out in the certificate , edit it .

  • one
    replace: pd.Dataframe -> pd.DataFrame - MaxU 6:43 pm
  • thanks a lot - young progrmmer

0