I want to use my own function in different code,every time i have to copy function and paste in new code,So i want to save function permanently,then i can access my own function in different code with single line function access.like we are using sum(),mean() function in same way want to use my own function.please help
def get_dataframe(list2):
wpr_day=[]
for i in range(len(list2)):
with open(list2[i], 'r') as csvfile:
reader = csv.reader(csvfile, delimiter='\t')
for row in reader:
if len(row) == 0:
continue
wpr_day.append(row)
for row1 in aa:
cols1=row1.split()
if(cols1[0]=='Date'):
date8.append(a[0])
for i in range(int(bins)):
dlist.append(aa[line_no])
elif(cols1[0]=='Time'):
time8.append(aa[line_no][7:15])
for i in range(int(bins)):
tlist.append(aa[line_no][7:15])
elif(cols1[0]=='Height(mtr)'):
blist.append((wpr_day))
fd=fd.append(wpr_day.iloc[(line_no+1):(line_no+(int(bins)+1)),:])
elif(cols1[0]=='Height'):
for v in range(line_no+1,line_no+(int(bins)+1)):
df_ht.append(aa[v])
df_snr.append(bb[v])
line_no=line_no+1
return result_df,dtime_uvw,date8,blist,df_ht,df_snr
i want to use my own function in different code with single line access example, result_df_slp,dtime_uvw_slp,date8_slp,blist_slp,xx,yy=get_dataframe(list_uvw1)