input: Write a function to create a k-means clustering algorithm in Python. The function should take as input the number of clusters 'k' and the dataset 'data', and return the clusters and the final centroids.
  assert kmeans(2, np.array([[1, 2], [1, 4], [1, 0], [4, 2], [4, 4], [4, 0]]))==(np.array([0, 0, 0, 1, 1, 1]), np.array([[1, 2], [4, 2]]))
  assert kmeans(1, np.array([[1, 2], [5, 9]]))==(np.array([0, 0]), np.array([[3, 5.5]]))
  assert kmeans(3, np.array([[1], [2], [6], [8], [9], [3]]))==(np.array([0, 0, 1, 2, 2, 1]), np.array([[1.5], [4.5], [8.5]]))
output: def kmeans(k, data):
      import numpy as np
      from sklearn.cluster import KMeans
      
      kmeans = KMeans(n_clusters=k, random_state=0).fit(data)
      return kmeans.labels_, kmeans.cluster_centers_