Write a Python program that uses numpy and pandas to normalize the columns of a dataset.
For example:
import numpy as np import pandas as pd = pd.read_csv("/content/sample_data/california_housing_test.csv") df = # put your code here norm print(norm.describe()) # min and max for each column should be 0 and 1
Write a Python program that uses numpy and pandas to find the index of the row that is the nearest neighbor to a row in a dataset.
For example:
import numpy as np import pandas as pd = pd.read_csv("/content/sample_data/california_housing_test.csv") df = # normalize code here norm = norm.to_numpy() # convert to numpy norm = 1 # row of data to search for nearest neighbor of index = norm[index, :] # row row = np.delete(norm, index, axis=0) # data excluding row test = # put your code here dist print(np.argmin(dist)) # print the index of the nearest row