Related
I am converting a legacy piece of code from F# to python where the Statistics.EmpiricalInvCDF() method is being used. I am having trouble replicating this in python. Here is the documentation for the F# method (https://numerics.mathdotnet.com/DescriptiveStatistics.html#Empirical-Distribution-Functions)
The usecase is as follows:
given list:
[0.03230313262534688, 0.002645726276523705, 0.01159854312582566, 0.0, 0.13521878503682389, 0.04221995336868746, 0.08088206039629423, 0.057687700498838576, -0.008598786901065152, 0.042606344490953324, 0.011082772426956695, 0.07893807796386074, 0.04300878546372856, 0.05772152131808002, 0.6630361642770063, -0.6198730776408921, 0.0481094085159463, 0.1848513533230482, -0.05577620426994041, 0.1029537374891358,
0.10357978356369431, 0.12254238149057754, 0.0911269446223479, 0.01932811172408364, 0.06932530865454888, -0.004110301433067377, 0.05802985444298547, 0.014621095574236822, -0.4615159515258704, -0.0012407645052369416, 0.03286149662750687, 0.012825027001045838, 0.051867696499045116, 0.020623116252775197, 0.02446469695619617, -0.015974966074344284, 0.03939323769642985, 0.5652557818438808, 0.02508486624629729,
0.026311401768164447, 0.03827223792998286, 0.03867025726520796, 0.04285045108159155, 0.018009295529766094, -0.18204238698737224, 0.03890486510159634, 0.03852683399121745, 0.17287557452039864, 0.022755267696871983, -0.008620053014231119, -0.21249945562739217, 0.009220137475520283, 0.030352843001682523, 0.0, -0.05843788432673845, 0.04484955168754013, 0.006260357642714611, 0.026573389912263958, 0.040894080492335595, 0.031156642520786194, -0.0035593767458410395, 0.056502452728941756, -0.011567687131086034, 0.019824618387320487, 0.01763256480698061, 0.03770396875280739, -0.2169605977183593, -0.04877029469675406, 0.03168933055587481, 0.032420547672104144, 0.03079075024741443, 0.1653012750667534, -0.006804319891639613, 0.008984055440418937, 0.0199408085772636, 0.020428069981471644, 0.04359405356382086, 0.015103293654879058, -0.023375468526050273, -0.00933222120934053, 0.02321095571832252, 0.049559948387087396, -0.0004151086139435974, -0.15655953473681927, 0.004304419664092396, 0.006671355318000576, -0.02449338530147379, 0.04478202409774672, -0.2629400383137885, 0.1954843319620695, 0.03686504887911304, -0.2684481840299527, -0.019138442894774923, 0.00621584280949767, 0.06460718118510203, -0.20020564142388894, -0.035691664770196155, 0.2577033446666525, 0.032908740476793354, 0.06685955822175448, 0.04128016090027627, 0.03690468165039895, -0.02095094349421612, 0.018320834968663716, 0.07261850788704553, 0.0005996187229608711, -0.005294975699828886, 0.07868580727177386, -0.14683416493836995, 0.06367912640840617, 0.08829914546925684, 0.01925506982025991, -0.01845931029495414, 0.016455918131923757, -0.10730938773869152, 0.06959721883549888, -0.24295927354223984, 0.038191715674122884, 0.2489265941534765, 0.25367195299667944, -0.24074284601722426, 0.04790264523942938, -0.2898539131116597, 0.46076135068477636, 0.16892117107930602, 0.032233962259842104, 0.10991351750112961, 0.0947295624169787, -0.31877746856009903, 0.08839333002165493, 0.05967730549716063, -0.012206209535519416, 0.06258238056246512, 0.11311371649813944, -0.18662709898356242, 0.042107091229495866, 0.025462668074737474, 0.07075281119631686, -0.026548329376822558, 0.051226289479552996, -0.23413933396499512, 0.1898393060388359, 0.028314404612467214, 0.02164091611437012, 0.055312288886916146, -0.30925915849671126, 0.1197828763807938, 0.06086095889478898, 0.03277084074489599, 0.034771448102962066, -0.006071302642726877, 0.015918735667438268, 0.10892314394119058, 0.10288895121802186, -0.24608601414818557, 0.04226840237554879, 0.1279809775740312, -0.019354369564949375, 0.0]
emp_inv = Statistics.EmpiricalInvCDF(list, 0.01)
expected output:
emp_inv = -0.52626813800271377
I've been trying to test out this google form filler but keep running into an issue with the submit button. This has never happened before and I am not sure why, every time I run the code it fills in all the boxes, however, it sometimes doesn't fill out the gender question and rarely or never hits submit or submit another response. The google form link is in the code below.
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium import webdriver
import random
from time import sleep
from random import randint
import random
s=Service('/Users) #have the current service installed here
driver = webdriver.Chrome(service=s)
url="https://forms.gle/sNCNuebKtpdF6j7t6"
driver.get(url)
datas = [
]
for i in range(10):
sampleList = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
val1 = random.choices(sampleList, weights=(5.8, 6.72, 7.5, 7.24, 6.8, 3.16, 3.5, 4.5, 1.2, 2.3), k=10) # 25,25,50
val2 = random.choices(sampleList, weights=(5.8, 6.7, 7.5, 7.2, 6.83, 9.1, 9.5, 8.5, 8.2, 8.3), k=10) # 25,25,50
val3 = random.choices(sampleList, weights=(5.8, 6.7, 7.52, 7.2, 6.8, 3.1, 4.5, 3.53, 1.2, 0.3), k=10) # 25,25,50
val4 = random.choices(sampleList, weights=(0.8, 2.7, 3.53, 3.2, 5.8, 4.12, 9.5, 9.5, 9.2, 9.3), k=10) # 25,25,50
val5 = random.choices(sampleList, weights=(1.78, 3.7, 5.5, 3.2, 6.8, 5.1, 9.51, 8.5, 8.2, 9.3), k=10) # 25,25,50
valx = random.randint(0,9)
datas.append([val1[valx],val2[valx],val3[valx],val4[valx],val5[valx]]) #this list prints out alright and gets the values needed
radiobuttons = driver.find_elements(By.CLASS_NAME, "appsMaterialWizToggleRadiogroupElContainer")
print(datas)
for data in datas: #for each mini list in the big list
print(data)
radiolist = [0, 1, 2, 3]
val0 = random.choices(radiolist, weights=(9.8,11.5,1.2,1.8), k=10)
print(val0)
rand = random.randint(0,9)
print(rand)
#radiobuttons[val0[rand]].click()
radiobuttons[1].click()
print(radiobuttons[val0[rand]])
count = 0 #count is 0
# contain input boxes
textboxes = driver.find_elements(By.CLASS_NAME, 'quantumWizTextinputPaperinputInput') #these textboxes and elements seem to work and get filled out
for value in textboxes:
# enter value
value.send_keys(data[count])
print(value)
# increment count value
count += 1
submit = WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "span[class*='appsMaterialWizButtonPaperbuttonContent ']"))).click() #this sometimes works but if so only once
# fill another response
print('hi')
another_response = WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.LINK_TEXT, 'Submit another response'))).click()
#this does not work at all
#textboxes = browser.find_elements_by_class_name("quantumWizTextinputPaperinputInput")
#radiobuttons = browser.find_elements_by_class_name("docssharedWizToggleLabeledLabelWrapper")
#checkboxes = browser.find_elements_by_class_name("quantumWizTogglePapercheckboxInnerBox")
#submitbutton = browser.find_element_by_class_name("appsMaterialWizButtonPaperbuttonContent")
# close the window
driver.close()
url="https://forms.gle/sNCNuebKtpdF6j7t6"
driver.get(url)
datas = []
for i in range(10):
sampleList = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
val1 = random.choices(sampleList, weights=(5.8, 6.72, 7.5, 7.24, 6.8, 3.16, 3.5, 4.5, 1.2, 2.3), k=10) # 25,25,50
val2 = random.choices(sampleList, weights=(5.8, 6.7, 7.5, 7.2, 6.83, 9.1, 9.5, 8.5, 8.2, 8.3), k=10) # 25,25,50
val3 = random.choices(sampleList, weights=(5.8, 6.7, 7.52, 7.2, 6.8, 3.1, 4.5, 3.53, 1.2, 0.3), k=10) # 25,25,50
val4 = random.choices(sampleList, weights=(0.8, 2.7, 3.53, 3.2, 5.8, 4.12, 9.5, 9.5, 9.2, 9.3), k=10) # 25,25,50
val5 = random.choices(sampleList, weights=(1.78, 3.7, 5.5, 3.2, 6.8, 5.1, 9.51, 8.5, 8.2, 9.3), k=10) # 25,25,50
valx = random.randint(0,9)
datas.append([val1[valx],val2[valx],val3[valx],val4[valx],val5[valx]]) #this list prints out alright and gets the values needed
print(datas)
for data in datas: #for each mini list in the big list
radiobuttons = driver.find_elements(By.CLASS_NAME, "appsMaterialWizToggleRadiogroupElContainer")
print(data)
radiolist = [0, 1, 2, 3]
val0 = random.choices(radiolist, weights=(9.8,11.5,1.2,1.8), k=10)
print(val0)
rand = random.randint(0,9)
print(rand)
#radiobuttons[val0[rand]].click()
radiobuttons[1].click()
print(radiobuttons[val0[rand]])
count = 0 #count is 0
# contain input boxes
textboxes = driver.find_elements(By.CLASS_NAME, 'quantumWizTextinputPaperinputInput') #these textboxes and elements seem to work and get filled out
for value in textboxes:
# enter value
value.send_keys(data[count])
print(value)
# increment count value
count += 1
try:
submit = WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//span[text()='Submit']")))
submit.click() #this sometimes works but if so only once
except Exception as e:
print(str(e))
# fill another response
print('hi')
try:
another_response = WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.LINK_TEXT, 'Submit another response')))
another_response.click()
except Exception as e:
print(str(e))
Your issues were in the radiobuttons as you need to regrab that element every loop due to page redirection so you ended up with stale elements and using the wrong selector for the submit button. With the following fixes it runs.
I am trying to build a categorical plot with hbar in bokeh, though it seems a bit odd that it does not follow the same concept as the vbar. I have tried few variations and I still have not been able to plot the data, I am only getting an empty canvas. If someone could help me out, it would be much appreciated.
I am using bokeh 1.3.4 in my system and in an webapp I am building in Flask, so it has to be either this version or below(feels a bit demanding, but it is software requirements).
I have done it with pandas_bokeh which makes it very simple, though I am adding interactivity to the plots to allow the viewer to play around and pandas_bokeh does the job and you ended up not learning it properly.
webapp draft so far
rX = df3.index.values
xL = ['Dublin New', 'Ireland New','Dublin Existing','Ireland Existing']
labelDict = {'2010': xL, '2011': xL, '2012': xL, '2013': xL, '2014': xL,'2015': xL,'2016': xL,'2017': xL, '2018': xL}
sourceT = ColumnDataSource(data=dict(x=df3.index.values,
y=df3['Dublin New'],
y1=df3['Ireland New'],
y2=df3['Dublin Existing'],
y3=df3['Ireland Existing']))
pT = figure(y_range=FactorRange(*labelDict), plot_height=350, plot_width=550, title='Properties Transactions in Ireland', tools='pan, wheel_zoom, box_zoom, reset')
pT.hbar(y=dodge('x', -0.5, range=pT.y_range), height=0.3, right='y', fill_color="#FDE724", source=sourceT)
#pT.hbar(y=dodge('x', -0.25, range=pT.y_range), height=0.3, right='y1', fill_color='#35B778', source=sourceT)
show(pT)
Here is the plot I would like to reproduce using bokeh, instead pandas_bokeh.
Thanks in advance for the help.
The value for the range parameter of the dodge should be the actual range:
range=pT.y_range # GOOD
You are passing the range end property, which is a number:
range=pT.y_range.end # BAD
EDIT: Without a complete, minimal reproducer, it is not possible to directly fix your code. The best that can be offered is a complete working example that demonstrates that hbar does work exactly equivalently to vbar, that hopefully will be useful to you by comparison, to figure out where your full code strays:
from bokeh.io import show
from bokeh.models import ColumnDataSource
from bokeh.plotting import figure
from bokeh.transform import dodge
fruits = ['Apples', 'Pears', 'Nectarines', 'Plums', 'Grapes', 'Strawberries']
years = ['2015', '2016', '2017']
data = {'fruits' : fruits,
'2015' : [2, 1, 4, 3, 2, 4],
'2016' : [5, 3, 3, 2, 4, 6],
'2017' : [3, 2, 4, 4, 5, 3]}
source = ColumnDataSource(data=data)
p = figure(y_range=fruits, x_range=(0, 10), plot_width=250, title="Fruit Counts by Year",
toolbar_location=None, tools="")
p.hbar(y=dodge('fruits', -0.25, range=p.y_range), right='2015', height=0.2, source=source,
color="#c9d9d3")
p.hbar(y=dodge('fruits', 0.0, range=p.y_range), right='2016', height=0.2, source=source,
color="#718dbf")
p.hbar(y=dodge('fruits', 0.25, range=p.y_range), right='2017', height=0.2, source=source,
color="#e84d60")
p.y_range.range_padding = 0.1
p.ygrid.grid_line_color = None
show(p)
#bigreddot Thanks a lot. I followed your approach and it works smoothly. I will try to work reserve the axis as I would rather to have the years in the yaxis.
Anyhow I really appreciated your help.
varT = ['Dublin New', 'Ireland New', 'Dublin Existing','Ireland Existing']
yearsT = df3.index.values.tolist()
dataT = {'var': var,
'2010': df3.iloc[0].values, '2011': df3.iloc[1].values,
'2012': df3.iloc[2].values, '2013': df3.iloc[3].values,
'2014': df3.iloc[4].values, '2015': df3.iloc[5].values,
'2016': df3.iloc[6].values, '2017': df3.iloc[7].values,
'2018': df3.iloc[8].values,
}
sourceTs = ColumnDataSource(data=dataT)
pT1 = figure(y_range=var, x_range=(0, df3.values.max()), plot_width=450, title='Properties Transactions in Ireland', tools='pan, wheel_zoom, box_zoom, reset')
pT1.hbar(y=dodge('var', -0.4, range=pT1.y_range), right='2010', height=0.1, source=sourceTs, color='#440154', legend=value('2010'))
pT1.hbar(y=dodge('var', -0.3, range=pT1.y_range), right='2011', height=0.1, source=sourceTs, color='#46317E', legend=value('2011'))
pT1.hbar(y=dodge('var', -0.2, range=pT1.y_range), right='2012', height=0.1, source=sourceTs, color='#365A8C', legend=value('2012'))
pT1.hbar(y=dodge('var', -0.1, range=pT1.y_range), right='2013', height=0.1, source=sourceTs, color='#277E8E', legend=value('2013'))
pT1.hbar(y=dodge('var', 0, range=pT1.y_range), right='2014', height=0.1, source=sourceTs, color='#1EA087', legend=value('2014'))
pT1.hbar(y=dodge('var', 0.1, range=pT1.y_range), right='2015', height=0.1, source=sourceTs, color='#49C16D', legend=value('2015'))
pT1.hbar(y=dodge('var', 0.2, range=pT1.y_range), right='2016', height=0.1, source=sourceTs, color='#9DD93A', legend=value('2016'))
pT1.hbar(y=dodge('var', 0.3, range=pT1.y_range), right='2017', height=0.1, source=sourceTs, color='#FDE724', legend=value('2017'))
pT1.hbar(y=dodge('var', 0.4, range=pT1.y_range), right='2018', height=0.1, source=sourceTs, color='#AADB32', legend=value('2018'))
pT1.legend.location='bottom_right'
#pT1.y_range.range_padding = 0.1
pT1.grid.grid_line_color = None
tick_labels_pt = {'10000':'10K','20000':'20K','30000':'30K','40000':'40K','50000':'50K'}
pT1.xaxis.major_label_overrides = tick_labels_pt
pT1.legend.background_fill_alpha=None
pT1.legend.border_line_alpha=0
pT1.legend.label_text_font_size = "11px"
pT1.legend.click_policy="hide"
pT1.title.text_font_size = '15px'
pT1.axis.major_label_text_font_style = 'bold'
#pT1.xaxis.major_label_text_font_style = 'bold'
pT1.toolbar.autohide = True
show(pT1)
Here is the outcome:
with the axis reversed:
varpti = ['Dublin New', 'Ireland New', 'Dublin Existing','Ireland Existing']
#the values of the y axis has to be in str format
yearspti = '2010','2011','2012', '2013', '2014', '2015', '2016', '2017', '2018' #df3.index.values.tolist()
datapti = {'years': yearspti,
'Dublin New': df3['Dublin New'].values,
'Ireland New': df3['Ireland New'].values,
'Dublin Existing': df3['Dublin Existing'].values,
'Ireland Existing': df3['Ireland Existing'].values
}
sourcepti = ColumnDataSource(data=datapti)
pti = figure(y_range=yearspti, x_range=(0, df3.values.max()), plot_height=500, plot_width=450, title='Properties Transactions in Ireland', tools='pan, wheel_zoom, box_zoom, reset')
pti.hbar(y=dodge('years', -0.2, range=pti.y_range), right='Dublin New', height=0.1, source=sourcepti, color='#440154', legend=value('Dublin New'))
pti.hbar(y=dodge('years', 0, range=pti.y_range), right='Ireland New', height=0.1, source=sourcepti, color='#30678D', legend=value('Ireland New'))
pti.hbar(y=dodge('years', 0.2, range=pti.y_range), right='Dublin Existing', height=0.1, source=sourcepti, color='#35B778', legend=value('Dublin Exsiting'))
pti.hbar(y=dodge('years', 0.4, range=pti.y_range), right='Ireland Existing', height=0.1, source=sourcepti, color='#FDE724', legend=value('Ireland Exsiting'))
When trying to calculate a transformation matrix between two systems with the library transformations and the function superimposition_matrix, I get the following error :
File "D:\Travail\Dev\projet Jarvis\collisions\Test dans
Jarvis\JarvisRobotics_20180717_1937\JarvisRobotics\outils_matrices.py",
line 839, in set_frame_passageV000
M = transformations.superimposition_matrix(list_base, list_ext, scale=True, usesvd=True) ValueError: eigenvector_of_symmetric_44()
failed
The data in entry are two list of ten vector(x,y,z):
<class 'list'>: [[2443.9128, -501.7427, -630.8925], [2126.8356, -703.2691, -678.1219], [1534.3236, -757.3283, -678.0219], [1532.8918, -339.4951, -682.6528], [2103.9974, -226.6539, -472.8035], [2297.246, 47.3245, -475.6743], [2429.3814, 88.5478, -476.0224], [2353.675, 614.8282, -447.7145], [1931.7996, 651.5278, -448.4745], [1604.6555, 664.6893, -448.8943]]
<class 'list'>: [[406.93, -373.8, 2559.99], [612.81, -65.74, 2566.76], [679.68, 520.63, 2542.36], [271.24, 532.19, 2612.08], [114.43, -31.73, 2439.24], [-157.93, -220.7, 2490.9], [-200.13, -350.38, 2501.29], [-722.9, -260.64, 2556.52], [-750.43, 160.15, 2551.35], [-759.14, 488.8, 2545.55]]
is anybody here to help me or to guide me to go further?
def set_frame_passage_(list_pt_ref_base, list_pt_ref_ext):
str_erreur = ''
if len(list_pt_ref_base) == len(list_pt_ref_ext):
nb_pts = len(list_pt_ref_base)
array_base = np.zeros((nb_pts, 3))
array_ext = np.zeros((nb_pts, 3))
lg_array = 0
for index in range(0, nb_pts):
array_base[lg_array] = list_pt_ref_base[index][:3]
array_ext[lg_array] = list_pt_ref_ext[index][:3]
lg_array += 1
M = superimposition_matrix(array_base, array_ext, scale=True)
# valeurs de sortie
xyzrpw = set_mat4x4_2_xyzrpw(M)
mat_rdk = mat4x4_numpy_2_rdk(M)
if not (not np.all(M) and xyzrpw and mat_rdk):
return False
return RetVal([True, dt.now, 'matrice de passage calculée avec succès !', M, xyzrpw, mat_rdk])
else:
str_erreur = 'Les tailles du tableau du référentiel base('
str_erreur += str(len(list_pt_ref_base))
str_erreur += ') et du référentiel extérieur('
str_erreur += str(len(list_pt_ref_ext))
str_erreur += ') ne sont pas de la même taille !'
print(str_erreur)
RetVal([False, dt.now, str_erreur])
list_ext_brute = [[406.93, -373.8, 2559.99, 0.0, -0.0, 0.0],
[612.81, -65.74, 2566.76, 0.0, -0.0, 0.0],
[679.68, 520.63, 2542.36, 0.0, -0.0, 0.0],
[271.24, 532.19, 2612.08, 0.0, -0.0, 0.0],
[114.43, -31.73, 2439.24, 0.0, -0.0, 0.0],
[-157.93, -220.7, 2490.9, 0.0, -0.0, 0.0],
[-200.13, -350.38, 2501.29, 0.0, -0.0, 0.0],
[-722.9, -260.64, 2556.52, 0.0, -0.0, 0.0],
[-750.43, 160.15, 2551.35, 0.0, -0.0, 0.0],
[-759.14, 488.8, 2545.55, 0.0, -0.0, 0.0],
[-358.39, 151.63, 2416.5, 0.0, -0.0, 0.0],
[-289.58, -60.31, 2410.38, 0.0, -0.0, 0.0],
[-86.04, 153.06, 2369.19, 0.0, -0.0, 0.0],
[-9.05, -92.79, 2361.71, 0.0, -0.0, 0.0]]
list_base_brute = [[2443.9128, -501.7427, -630.8925, -179.0604, 0.4017, 145.2487],
[2126.8356, -703.2691, -678.1219, -179.6825, 0.552, 124.2606],
[1534.3236, -757.3283, -678.0219, 179.9398, 0.6337, 88.9192],
[1532.8918, -339.4951, -682.6528, 179.7809, 0.5975, 74.2169],
[2103.9974, -226.6539, -472.8035, -179.4523, 0.3239, 153.7627],
[2297.246, 47.3245, -475.6743, -179.4523, 0.3237, 153.7627],
[2429.3814, 88.5478, -476.0224, -179.7454, -0.5832, -109.2463],
[2353.675, 614.8282, -447.7145, -179.7454, -0.5833, -109.2462],
[1931.7996, 651.5278, -448.4745, -179.7454, -0.5835, -109.2461],
[1604.6555, 664.6893, -448.8943, -179.7455, -0.5835, -109.2461],
[1925.4354, 246.4732, -379.1885, -179.7455, -0.5836, -109.2458],
[2137.8614, 172.319, -378.1896, -179.7455, -0.5836, -109.2459],
[1919.7934, -31.8006, -376.11, -179.7455, -0.5837, -109.2459],
[2164.5074, -117.227, -374.9585, -179.7455, -0.5837, -109.2459]]
mat_ = set_frame_passage_(list_base_brute, list_ext_brute)
if mat_.b_done:
print('-------------------------------------------------------------------------------------------------------')
print('xyzrpw = ' + str(mat_.res2))
print('-------------------------------------------------------------------------------------------------------')
print('vecteur translation : x=' + str(mat_.res2[0]) + ', y=' + str(mat_.res2[1]) + ', z=' + str(mat_.res2[2]))
print('angles de rotation : r=' + str(mat_.res2[3]) + ', p=' + str(mat_.res2[4]) + ', w=' + str(mat_.res2[5]))
print('----------------------------------------------------------------------------')
print('Matrice de rotation numpy 4x4:')
print(mat_.res1)
print('----------------------------------------------------------------------------')
print('Matrice de rotation roboDK 4x4:')
print(mat_.res3)
else:
print(mat_.str_msg)
For information, I have found why I got this error:
The module transformation.py that i get is not complete and some functions are missing (in particular the one that raise an error) and due to the instruction "from transformation import *", there was apparently a default... I just use import the function that I need (superimposition_matrix) and I just test.
So now, the calculation passed but Now the result is not OK.
By an another software that we use for the robots ABB (Robotstudio), we have a function dedicated to the calculation of the Transformation Frames which is "DefAccFrame - Definition of an Accurate Frame between two systems". When we use it, we obtains the correct value (tested in real) and for now, this code does not work.
The issue is that this instruction is accessible only on ABB robots and I would to find a way to use it in any controller.
That's where I am today.
Really Thanks to everybody for all the help.
I am having a very weird and frustrating error.
The problem is very simple:
>>> mylist
[70.71, 67.23, 60.1, 62.52, 64.14, 65.4, 68.84, 61.04, 66.95, 62.22, 63.73, 62.04, 57.12, 61.3, 65.48, 61.49, 66.94, 62.68, 60.31, 64.38, 62.84, 63.03, 67.12, 60.65, 61.68, 64.0, 62.91, 61.36, 60.65, 62.45, 64.22, 66.4, 59.96, 57.03, 66.4, 60.43, 64.05, 64.09, 50.94, 39.84, 45.12, 63.39, 55.62, 55.58, 58.04, 59.91, 60.05, 57.3, 61.83, 63.87, 50.58, 62.56, 60.75, 58.9, 62.99, 61.65, 59.09, 59.91, 64.66, 61.1, 61.31, 59.62, 56.65, 60.1, 66.04, 60.57, 59.77, 53.0, 60.84, 61.75, 64.53, 52.0, 62.08, 67.69, 60.62, 55.04, 54.49, 30.82, 48.32, 59.66, 62.56, 66.71, 70.4, 55.13, 59.32, 63.06, 56.0, 56.19, 65.9, 61.01, 62.03, 59.43, 62.82, 56.83, 62.91, 76.44, 68.01, 61.0, 63.51, 58.12, 65.77, 56.88, 63.18, 69.03, 63.34, 54.91, 60.25, 64.79, 64.17, 61.86, 53.05, 63.42, 57.08, 60.36, 59.62, 64.69, 59.78, 58.34, 65.19, 55.49, 73.53, 56.25, 61.09, 53.35, 63.45, 64.34, 29.79, 59.75, 67.7, 59.74, 52.17, 61.29, 58.88, 55.68, 55.81, 57.52, 62.0, 62.49, 60.47, 61.86, 56.94, 56.31, 61.82, 62.01, 59.99, 59.4, 57.9, 63.08, 64.56, 60.77, 63.95, 60.1, 66.22, 58.05, 66.25, 62.34, 61.17, 64.04, 64.08, 61.1, 56.19, 61.04, 53.13, 64.58, 60.96, 58.97, 59.43, 66.22, 58.4, 55.68, 35.47, 42.6, 57.57, 58.3, 60.84, 62.52, 54.86, 60.9, 60.99, 60.47, 61.45, 58.34, 62.17, 63.68, 62.4, 64.62, 56.78, 59.14, 61.47, 54.7, 55.3, 58.09, 62.95, 61.47, 57.69, 62.45, 54.86, 58.51, 60.52, 54.56]
An now I try to get the min value:
>>> min(mylist)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'int' object is not callable
Why?
Most probably you have a variable named min that shadowed the built in min function. If you are using the interactive console just do:
del min
Also consider using numpy, as it can be faster on bigger lists:
>>> import numpy
>>> numpy.min(mylist)
I can not reproduce this. min(mylist) returns 29.79.
You are probably using a variable called min in your code. Don't do this.