I've written the following code in Python. I want to write this code in Mathematica but I don't know Mathematica. How can I convert this code to a code in Mathematica?
Thanks in advance.
# Python program to read an excel file
# import openpyxl module
import openpyxl
import easygui
import pandas as pd
import math
path=easygui.fileopenbox('Choose your excel file')
n=int(input('Enter the number of points: '))
m=int(input('Enter the number of dimensions: '))
k=input('Enter new point: ')
e=float(input('Enter Eta: '))
k=k.split()
k=[int(i) for i in k]
df = pd.read_excel(path, sheet_name='Sheet1')
t=0
for j in range(1,m+1) :
t=t+pow(k[j-1]-df.loc[0,j],2)
min=round(math.sqrt(t),3)
for i in range(1,n):
t=0
for j in range(1,m+1) :
t=t+pow(k[j-1]-df.loc[i,j],2)
t=round(math.sqrt(t),3)
if t < min :
min=t
T=e*min
counter=0
Y=0
for i in range(n):
t = 0
for j in range(1, m + 1):
t = t + pow(k[j-1] - df.loc[i, j], 2)
t = round(math.sqrt(t), 3)
if t <= T :
counter +=1
Y=Y+df.loc[i,'y']
print(Y/counter)