Attribute Error 'Series' object has no attribute 'split'

def embedding_output(X):
maxLen = 10
embd_dim = 50
embedding_out = np.zeros((X.shape[0], maxLen, embd_dim))

for ix in range(X.shape[0]): #every sentence
    X[ix] = X[ix].split()
    for ij in range(len(X[ix])): #every word
        try:
            embedding_out[ix][ij] = embeddings_index[X[ix][ij]]
        except:
            embedding_out[ix][ij] = np.zeros((50,))
return embedding_out

Hey @dishagoyal2, make sure you have converted the values to numpy array, by using .values after reading the csv file. If error still persists share your ipynb notebook by directly uploading it on google drive and sharing the link here.

Hope this cleared your doubt. :blush:

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.