212
Xuddi shunday ilmiy ishlarga murojaatning boshqa shakllari uchun ham umumlashgan
bahoni keltirib chiqarish mumkin.
Dastur kodi: import numpy as np
import math
import random
from tkinter import *
from tkinter import filedialog
from functools import partial
w1 = Tk()
w1.title('My app')
w1.geometry('1000x700')
def ochish():
w1.filename = filedialog.askopenfilename(title="fileni tanlash", filetypes=(("csv
files","*.csv"),("all files","*.*")))
w1.destroy()
Button(w1,width=10, text='fileni tanlash', bg="red", command=ochish).grid(row=0,
column=0)
w1.mainloop()
fayl = w1.filename
xy=np.loadtxt(fayl, delimiter=';', dtype=str)
n,m=np.shape(xy)
nat=xy[0:m,:7]
x1=xy[0:2,:]
xy=xy[2:,:]
x=xy[:,2:]
b=True
t=float(x1[0][1])
if ((t==0) or(t==1)):
x=xy[:,1:]
b=False
if b:
nat=np.delete(nat,1,0)
nat=np.delete(nat,1,0)
nat=np.delete(nat,1,0)
nat[:,1]=x1[1:,0:-1]
else:
nat=np.delete(nat,1,0)
nat=np.delete(nat,1,0)
nat[:,1]=x1[1:,1:-1]
n,m=np.shape(x)
m=m-1
x=x.astype(float)
#print(x)