AttributeError: 'DataFrame' object has no attribute 'Height'
PS On above answer by JAB - if there is clearly spaces in your column names use skipinitialspace=True in read_csv e.g.
df = pd.read_csv('/path../NavieBayes.csv',skipinitialspace=True)
I have run into a similar issue before when reading from csv
. Assuming it is the same:
col_name =df.columns[0]
df=df.rename(columns = {col_name:'new_name'})
The error in my case was caused by (I think) by a byte order marker in the csv or some other non-printing character being added to the first column label. df.columns
returns an array of the column names. df.columns[0]
gets the first one. Try printing it and seeing if something is odd with the results.