Here is my code:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import os
os.chdir("/Users/Jeffin/Desktop")
data =pd.read_csv('ccc.csv')
print(data.shape)
data = data.drop(index=[0])
print(data)
x1 = data.drop(data.columns[0:5],axis=1)
x1= x1.drop(x1.columns[1:25],axis=1)
print(x1)
y1 = data.drop(data.columns[0:12],axis=1)
y1= y1.drop(y1.columns[1:25],axis=1)
print(y1)
from sklearn.model_selection import train_test_split
[x_t, x_r, y_t, y_r]=train_test_split(x1,y1,test_size= 0.3,random_state=0)
from sklearn.linear_model import LinearRegression
model = LinearRegression()
model.fit(x_t,y_t)
pre = model.predict(x_r)
print(pre.shape)
acc = model.score(x_t,y_t)
plt.scatter(x_t,y_t)
I am getting error in the last line as
Traceback (most recent call last):
File "C:
File "Clot.py", line 2862, in scatter
...
...
for val in OrderedDict.fromkeys(data)
TypeError: unhashable type: 'numpy.ndarray'
Being new to ML help me to solve this. Thanks in advance.
for val in OrderedDict.fromkeys(data)isn't in the code you posted, please edit the question to show the actual code, or post the full error traceback