Last answered:

12 Aug 2023

Posted on:

10 Aug 2023

0

Error when try to execute k Means code

When i tried to get the K means on the same standarized dataset with scalar and that was previously worked on the dendrogram (segmentation_std), i got an error as follow:

AttributeError: 'NoneType' object has no attribute 'split'


1 answers ( 0 marked as helpful)
Instructor
Posted on:

12 Aug 2023

0

Hi Arsany, 

Here's how you can troubleshoot this issue:

1) Check the Data Loading:

Ensure that the dataset (segmentation_std) was loaded correctly. If you're using a library like pandas, ensure that the DataFrame is not empty or None.
2) Check Data Preprocessing Steps:

Review the preprocessing steps leading up to the clustering. If any function or method is supposed to return a value but isn't, then it could return None by default, which might lead to the error.
3) Check Method Calls:

If you're chaining method calls (e.g., some_method().split()), ensure that some_method() isn't returning None.

Hope this helps!

Submit an answer