change fillna to dropna

This commit is contained in:
jakubknczny 2021-06-25 20:35:54 +02:00
parent 84a8fb17e2
commit 754e8dfb4f

View File

@ -43,7 +43,7 @@ def is_finished(old_medoids, new_medoids):
def kmedoids(num_samples, num_clusters): def kmedoids(num_samples, num_clusters):
df = pd.read_csv('CC GENERAL.csv', index_col='CUST_ID') df = pd.read_csv('CC GENERAL.csv', index_col='CUST_ID')
df = df[:num_samples].fillna(0) df = df[:num_samples].dropna()
df_scaled = pd.DataFrame(StandardScaler().fit_transform(df)) df_scaled = pd.DataFrame(StandardScaler().fit_transform(df))
# initialize medoids (at random) # initialize medoids (at random)