import numpy as np
import pandas as pd

def k_medoids(data, k):
    n = data.shape[0]
    # Initialize the cluster centers
    cluster_centers = np.zeros((k, data.shape[1]))
    for i in range(k):
        j = np.random.choice(n)
        cluster_centers[i] = data[j]

    # K-medoids iteration
    cluster_identities = np.zeros(n)
    for i in range(k):
        # Find the k-medoids for the current cluster
        min_dist = float('inf')
        for j in range(n):
            d = (data[j] - cluster_centers[cluster_identities[j]])
            dist = np.sum(d**2)
            if dist < min_dist:
                min_dist = dist
                cluster_identities[j] = i
        # Update the cluster centers
        cluster_centers[i, :] = data[cluster_identities == i].mean(axis=0)

    return cluster_identities, cluster_centers

df =  pd.read_csv('C:\\Users\\lenovo\\OneDrive\\Desktop\\test.csv')
k_medoids(df['X','Y'],2)

this code prints out error :
KeyError: ('X', 'Y')

The above exception was the direct cause of the following exception:

KeyError                                  Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_5300\3131643456.py in <module>
     27 
     28 df =  pd.read_csv('C:\\Users\\lenovo\\OneDrive\\Desktop\\test.csv')
---> 29 k_medoids(df['X','Y'],2)

~\anaconda3\lib\site-packages\pandas\core\frame.py in __getitem__(self, key)
   3503             if self.columns.nlevels > 1:
   3504                 return self._getitem_multilevel(key)
-> 3505             indexer = self.columns.get_loc(key)
   3506             if is_integer(indexer):
   3507                 indexer = [indexer]

~\anaconda3\lib\site-packages\pandas\core\indexes\base.py in get_loc(self, key, method, tolerance)
   3629                 return self._engine.get_loc(casted_key)
   3630             except KeyError as err:
-> 3631                 raise KeyError(key) from err
   3632             except TypeError:
   3633                 # If we have a listlike key, _check_indexing_error will raise

KeyError: ('X', 'Y')

why? Write your response with exactly 4 paragraphs, separated with the markdown divider: ***.
user