Matplotlib single array. How to place Marker? - python

I need help with placing a marker on a plot where I have a single array to plot it.
I am receiving the data in ASCII format from one Instrument and I need to show the maximum from the data.
data1 = ['+3.613512E+003', '+3.254965E+003', '+2.938281E+003', '+2.678804E+003', '+2.461425E+003', '+2.282802E+003', '+2.128352E+003', '+2.001264E+003', '+1.883186E+003', '+1.774222E+003', '+1.681822E+003', '+1.601852E+003', '+1.524412E+003', '+1.458368E+003', '+1.394319E+003', '+1.338477E+003', '+1.282567E+003', '+1.206847E+003', '+1.305292E+003', '+1.175656E+003', '+1.082040E+003', '+1.050308E+003', '+1.033320E+003', '+9.772695E+002', '+9.437070E+002', '+1.039622E+003', '+8.937933E+002', '+8.677546E+002', '+8.302201E+002', '+8.098771E+002', '+7.839208E+002', '+7.641392E+002', '+7.450735E+002', '+7.270004E+002', '+7.100223E+002', '+6.938470E+002', '+6.777757E+002', '+6.627379E+002', '+6.484218E+002', '+6.346696E+002', '+6.215515E+002', '+6.091346E+002', '+5.969252E+002', '+5.858983E+002', '+5.738594E+002', '+5.632513E+002', '+5.531273E+002', '+5.434016E+002', '+5.338579E+002', '+5.245516E+002', '+5.156342E+002', '+5.069659E+002', '+4.985686E+002', '+4.904806E+002', '+4.827541E+002', '+4.751310E+002', '+4.678062E+002', '+4.606243E+002', '+4.540762E+002', '+4.473115E+002', '+4.408354E+002', '+4.345136E+002', '+4.282921E+002', '+4.223657E+002', '+4.166439E+002', '+4.109633E+002', '+4.052994E+002', '+4.001460E+002', '+3.950479E+002', '+3.895703E+002', '+3.846584E+002', '+3.799026E+002', '+3.751604E+002', '+3.705536E+002', '+3.660702E+002', '+3.616293E+002', '+3.573076E+002', '+3.532868E+002', '+3.491588E+002', '+3.450848E+002', '+3.411576E+002', '+3.377792E+002', '+3.338940E+002', '+3.302851E+002', '+3.267181E+002', '+3.232689E+002', '+3.197983E+002', '+3.162835E+002', '+3.130360E+002', '+3.098477E+002', '+3.066972E+002', '+3.036430E+002', '+3.005474E+002', '+3.017997E+002', '+2.970689E+002', '+2.943995E+002', '+2.906300E+002', '+2.872129E+002', '+2.844009E+002', '+2.817743E+002', '+2.791834E+002', '+2.766238E+002', '+2.741659E+002', '+2.715812E+002', '+2.691083E+002', '+2.667481E+002', '+2.643162E+002', '+2.620564E+002', '+2.597600E+002', '+2.575768E+002', '+2.553911E+002', '+2.532829E+002', '+2.512116E+002', '+2.491187E+002', '+2.471341E+002', '+2.451769E+002', '+2.431930E+002', '+2.412911E+002', '+2.394064E+002', '+2.375465E+002', '+2.357066E+002', '+2.338903E+002', '+2.321306E+002', '+2.304057E+002', '+2.286812E+002', '+2.269622E+002', '+2.252647E+002', '+2.236192E+002', '+2.220235E+002', '+2.204091E+002', '+2.187952E+002', '+2.172741E+002', '+2.157154E+002', '+2.142141E+002', '+2.127425E+002', '+2.112572E+002', '+2.098584E+002', '+2.084018E+002', '+2.069778E+002', '+2.055735E+002', '+2.042013E+002', '+2.028710E+002', '+2.015256E+002', '+2.001832E+002', '+1.988509E+002', '+1.976151E+002', '+1.962977E+002', '+1.950415E+002', '+1.937939E+002', '+1.925864E+002', '+1.913902E+002', '+1.901835E+002', '+1.890085E+002', '+1.878839E+002', '+1.866942E+002', '+1.855853E+002', '+1.844479E+002', '+1.833570E+002', '+1.822493E+002', '+1.812235E+002', '+1.801365E+002', '+1.790499E+002', '+1.780047E+002', '+1.769968E+002', '+1.759927E+002', '+1.750180E+002', '+1.740273E+002', '+1.730415E+002', '+1.720515E+002', '+1.711011E+002', '+1.701719E+002', '+1.691869E+002', '+1.682416E+002', '+1.673085E+002', '+1.664250E+002', '+1.655093E+002', '+1.646449E+002', '+1.637369E+002', '+1.628466E+002', '+1.619780E+002', '+1.611095E+002', '+1.602561E+002', '+1.594323E+002', '+1.585906E+002', '+1.577531E+002', '+1.569217E+002', '+1.561373E+002', '+1.553389E+002', '+1.544064E+002', '+1.536059E+002', '+1.528021E+002', '+1.520318E+002', '+1.512934E+002', '+1.505179E+002', '+1.497283E+002', '+1.489904E+002', '+1.482520E+002', '+1.475254E+002', '+1.467694E+002', '+1.460747E+002', '+1.453611E+002', '+1.446382E+002', '+1.439315E+002', '+1.432143E+002', '+1.425103E+002', '+1.417149E+002', '+1.410070E+002', '+1.402541E+002', '+1.395410E+002', '+1.388785E+002', '+1.381431E+002', '+1.373078E+002', '+1.684952E+002', '+1.735877E+002', '+1.736905E+002', '+1.724396E+002', '+1.723501E+002', '+1.712648E+002', '+1.702213E+002', '+1.694995E+002', '+1.641237E+002', '+1.672958E+002', '+1.667476E+002', '+1.663030E+002', '+1.641203E+002', '+1.632126E+002', '+1.633912E+002', '+1.483224E+002', '+1.620106E+002', '+1.601923E+002', '+1.480895E+002', '+1.578381E+002', '+1.538800E+002', '+1.560681E+002', '+1.555004E+002', '+1.551293E+002', '+1.540278E+002', '+1.538509E+002', '+1.137378E+002', '+1.149281E+002', '+1.331568E+002', '+1.163174E+002', '+1.484713E+002', '+1.374809E+002', '+1.209934E+002', '+1.355725E+002', '+1.244279E+002', '+1.306587E+002', '+1.331157E+002', '+1.183870E+002', '+1.453551E+002', '+1.456716E+002', '+1.460490E+002', '+1.468411E+002', '+1.246836E+002', '+1.068057E+002', '+1.070509E+002', '+1.058016E+002', '+1.050916E+002', '+1.045803E+002', '+1.040473E+002', '+1.038528E+002', '+1.035256E+002', '+1.031659E+002', '+1.036214E+002', '+1.028437E+002', '+1.025061E+002', '+1.020744E+002', '+1.012982E+002', '+1.005843E+002', '+9.998238E+001', '+9.969476E+001', '+9.923706E+001', '+9.881256E+001', '+9.842982E+001', '+9.800894E+001', '+9.748767E+001', '+9.712620E+001', '+9.671126E+001', '+9.626345E+001', '+9.584901E+001', '+9.545324E+001', '+9.508974E+001', '+9.469621E+001', '+9.432220E+001', '+9.393491E+001', '+9.353947E+001', '+9.313336E+001', '+9.277773E+001', '+9.238824E+001', '+9.200987E+001', '+9.167109E+001', '+9.128713E+001', '+9.091743E+001', '+9.057329E+001', '+9.020973E+001', '+8.984316E+001', '+8.949557E+001', '+8.912196E+001', '+8.875691E+001', '+8.841611E+001', '+8.805997E+001', '+8.772364E+001', '+8.736395E+001', '+8.701781E+001', '+8.669288E+001', '+8.634227E+001', '+8.601115E+001', '+8.567466E+001', '+8.535136E+001', '+8.501521E+001', '+8.468584E+001', '+8.436098E+001', '+8.402540E+001', '+8.369189E+001', '+8.339007E+001', '+8.306447E+001', '+8.268069E+001', '+8.237523E+001', '+8.205933E+001', '+8.173785E+001', '+8.143002E+001', '+8.110356E+001', '+8.081547E+001', '+8.049152E+001', '+8.018866E+001', '+7.988463E+001', '+7.958813E+001', '+7.929669E+001', '+7.898972E+001', '+7.870305E+001', '+7.840586E+001', '+7.810417E+001', '+7.781810E+001', '+7.751254E+001', '+7.724322E+001', '+7.695685E+001', '+7.667106E+001', '+7.638483E+001', '+7.608351E+001', '+7.582215E+001', '+7.553214E+001', '+7.525329E+001', '+7.498496E+001', '+7.471650E+001', '+7.443971E+001', '+7.415194E+001', '+7.388024E+001', '+7.361698E+001', '+7.334940E+001', '+7.308756E+001', '+7.281303E+001', '+7.254472E+001', '+7.226702E+001', '+7.201777E+001', '+7.174941E+001', '+7.147430E+001', '+7.121555E+001', '+7.096093E+001', '+7.071474E+001', '+7.045128E+001', '+7.021187E+001', '+6.993744E+001', '+6.967589E+001', '+6.944630E+001', '+6.917857E+001', '+6.895017E+001', '+6.870533E+001', '+6.844669E+001', '+6.820834E+001', '+6.795781E+001', '+6.770843E+001', '+6.745764E+001', '+6.723641E+001', '+6.698412E+001', '+6.674328E+001', '+6.652545E+001', '+6.619181E+001', '+6.596429E+001', '+6.571574E+001', '+6.548972E+001', '+6.525136E+001', '+6.502782E+001', '+6.480130E+001', '+6.456667E+001', '+6.434721E+001', '+6.412099E+001', '+6.388386E+001', '+6.366047E+001', '+6.343237E+001', '+6.320449E+001', '+6.298954E+001', '+6.276783E+001', '+6.255270E+001', '+6.232435E+001', '+6.210109E+001', '+6.188115E+001', '+6.166356E+001', '+6.143953E+001', '+6.121707E+001', '+6.100292E+001', '+6.078659E+001', '+6.057097E+001', '+6.035145E+001', '+6.014175E+001', '+5.991059E+001', '+5.970481E+001', '+5.949521E+001', '+5.927445E+001', '+5.907165E+001', '+5.885614E+001', '+5.864709E+001', '+5.843498E+001', '+5.822685E+001', '+5.801301E+001', '+5.780876E+001', '+5.759846E+001', '+5.739663E+001', '+5.718951E+001', '+5.698102E+001', '+5.678605E+001', '+5.657612E+001', '+5.637002E+001', '+5.616689E+001', '+5.596377E+001', '+5.576709E+001', '+5.557257E+001', '+5.536623E+001', '+5.516058E+001', '+5.496573E+001', '+5.476174E+001', '+5.456344E+001', '+5.436157E+001', '+5.416981E+001', '+5.397050E+001', '+5.377424E+001', '+5.357103E+001', '+5.336912E+001', '+5.316929E+001', '+5.297410E+001', '+5.276654E+001', '+5.257870E+001', '+5.238750E+001', '+5.220484E+001', '+5.204231E+001', '+5.190308E+001', '+5.178245E+001', '+5.165954E+001', '+5.153503E+001', '+5.138365E+001', '+5.120867E+001', '+5.102927E+001', '+5.083576E+001', '+5.065108E+001', '+5.045392E+001', '+5.025868E+001', '+5.006661E+001', '+4.988470E+001', '+4.969613E+001', '+4.951303E+001', '+4.933138E+001', '+4.914930E+001', '+4.896135E+001', '+4.877748E+001', '+4.860034E+001', '+4.841330E+001', '+4.824212E+001', '+4.806575E+001', '+4.788797E+001', '+4.771051E+001', '+4.753675E+001', '+4.735909E+001', '+4.718176E+001', '+4.700731E+001', '+4.683031E+001', '+4.665898E+001', '+4.648703E+001', '+4.631637E+001', '+4.614460E+001', '+4.597308E+001', '+4.580191E+001', '+4.562511E+001', '+4.545533E+001', '+4.528366E+001', '+4.512331E+001', '+4.495305E+001', '+4.478601E+001', '+4.461633E+001', '+4.444767E+001', '+4.428210E+001', '+4.411116E+001', '+4.395391E+001', '+4.379014E+001', '+4.362938E+001', '+4.346444E+001', '+4.330422E+001', '+4.313985E+001', '+4.298162E+001', '+4.282053E+001', '+4.265580E+001', '+4.250266E+001', '+4.234859E+001', '+4.218993E+001', '+4.203496E+001', '+4.188165E+001', '+4.172267E+001', '+4.156570E+001', '+4.141064E+001', '+4.125544E+001', '+4.110427E+001', '+4.095432E+001', '+4.080393E+001', '+4.065228E+001', '+4.049882E+001', '+4.034602E+001', '+4.018733E+001', '+4.003918E+001', '+3.989019E+001', '+3.974211E+001', '+3.959248E+001', '+3.943698E+001', '+3.928801E+001', '+3.913195E+001', '+3.897686E+001', '+3.882536E+001', '+3.867223E+001', '+3.852634E+001', '+3.837497E+001', '+3.822211E+001', '+3.806639E+001', '+3.791784E+001', '+3.776393E+001', '+3.760722E+001', '+3.746251E+001', '+3.731363E+001', '+3.716455E+001', '+3.701986E+001', '+3.687104E+001', '+3.672052E+001', '+3.657313E+001', '+3.642542E+001', '+3.628076E+001', '+3.614508E+001', '+3.600813E+001', '+3.586538E+001', '+3.573092E+001', '+3.559783E+001', '+3.545735E+001', '+3.531992E+001', '+3.518596E+001', '+3.505482E+001', '+3.491584E+001', '+3.478728E+001', '+3.464755E+001', '+3.450635E+001', '+3.436318E+001', '+3.422562E+001', '+3.408432E+001', '+3.394158E+001', '+3.380819E+001', '+3.366784E+001', '+3.352764E+001', '+3.339268E+001', '+3.325951E+001', '+3.312002E+001', '+3.298310E+001', '+3.285632E+001', '+3.273411E+001', '+3.260328E+001', '+3.248444E+001', '+3.235519E+001', '+3.223281E+001', '+3.209831E+001', '+3.196900E+001', '+3.184067E+001', '+3.171203E+001', '+3.158613E+001', '+3.145369E+001', '+3.132057E+001', '+3.118515E+001', '+3.104594E+001', '+3.090917E+001', '+3.076966E+001', '+3.062852E+001', '+3.048870E+001', '+3.034690E+001', '+3.021327E+001', '+3.006848E+001', '+2.992911E+001', '+2.978255E+001', '+2.963571E+001', '+2.949521E+001', '+2.935749E+001', '+2.922154E+001', '+2.908255E+001', '+2.894538E+001', '+2.880389E+001', '+2.866224E+001', '+2.852138E+001', '+2.838099E+001', '+2.824103E+001', '+2.810569E+001', '+2.796936E+001', '+2.782681E+001', '+2.769358E+001', '+2.755541E+001', '+2.741259E+001', '+2.727313E+001', '+2.713605E+001', '+2.699783E+001', '+2.686083E+001', '+2.672147E+001', '+2.658437E+001', '+2.644625E+001', '+2.630801E+001', '+2.616512E+001', '+2.603101E+001', '+2.589232E+001', '+2.575454E+001', '+2.561644E+001', '+2.547833E+001', '+2.534183E+001', '+2.520264E+001', '+2.505910E+001', '+2.492208E+001', '+2.477909E+001', '+2.464663E+001', '+2.451152E+001', '+2.437465E+001', '+2.423483E+001', '+2.409598E+001', '+2.395972E+001', '+2.382007E+001', '+2.367959E+001', '+2.354270E+001', '+2.340146E+001', '+2.326394E+001', '+2.312208E+001', '+2.298558E+001', '+2.283982E+001', '+2.269906E+001', '+2.255732E+001', '+2.241614E+001', '+2.227514E+001', '+2.214171E+001', '+2.199491E+001', '+2.185603E+001', '+2.171301E+001', '+2.157040E+001', '+2.143086E+001', '+2.128905E+001', '+2.115195E+001', '+2.101151E+001', '+2.087426E+001', '+2.073877E+001', '+2.059953E+001', '+2.045867E+001', '+2.031900E+001', '+2.018134E+001', '+2.004735E+001', '+1.991422E+001', '+1.977881E+001', '+1.964567E+001', '+1.951425E+001', '+1.938622E+001', '+1.925342E+001', '+1.912563E+001', '+1.899960E+001', '+1.887360E+001', '+1.875029E+001', '+1.862742E+001', '+1.850768E+001', '+1.838442E+001', '+1.826034E+001', '+1.814026E+001', '+1.801099E+001', '+1.789039E+001', '+1.777108E+001', '+1.764902E+001', '+1.752822E+001', '+1.741544E+001', '+1.729658E+001', '+1.718318E+001', '+1.706901E+001', '+1.696012E+001', '+1.685051E+001', '+1.673970E+001', '+1.663136E+001', '+1.651960E+001', '+1.640636E+001', '+1.628257E+001', '+1.616190E+001', '+1.603957E+001', '+1.591751E+001', '+1.578919E+001', '+1.566058E+001', '+1.552285E+001', '+1.538595E+001', '+1.523934E+001', '+1.508937E+001', '+1.494112E+001', '+1.478972E+001', '+1.463580E+001', '+1.447811E+001', '+1.431762E+001', '+1.415689E+001', '+1.399179E+001', '+1.382116E+001', '+1.365070E+001', '+1.348708E+001', '+1.332933E+001', '+1.317231E+001', '+1.301657E+001', '+1.285960E+001', '+1.270512E+001', '+1.254426E+001', '+1.238700E+001', '+1.223031E+001', '+1.207788E+001', '+1.192497E+001', '+1.177854E+001', '+1.162967E+001', '+1.148486E+001', '+1.134234E+001', '+1.120537E+001', '+1.106905E+001', '+1.094538E+001', '+1.082553E+001', '+1.071436E+001', '+1.061366E+001', '+1.051900E+001', '+1.043256E+001', '+1.035990E+001', '+1.030024E+001', '+1.025809E+001', '+1.022952E+001', '+1.021560E+001', '+1.022234E+001', '+1.023454E+001', '+1.027127E+001', '+1.031346E+001', '+1.037197E+001', '+1.044420E+001', '+1.052554E+001', '+1.061443E+001', '+1.070701E+001', '+1.080547E+001', '+1.090605E+001', '+1.100354E+001', '+1.110940E+001', '+1.121485E+001', '+1.132166E+001', '+1.143146E+001', '+1.154234E+001', '+1.165479E+001', '+1.176454E+001', '+1.188949E+001', '+1.201623E+001', '+1.216325E+001', '+1.232034E+001', '+1.248926E+001', '+1.266935E+001', '+1.284831E+001', '+1.302880E+001', '+1.321305E+001', '+1.338861E+001', '+1.355856E+001', '+1.372606E+001', '+1.387506E+001', '+1.401838E+001', '+1.414206E+001', '+1.424846E+001', '+1.433813E+001', '+1.440696E+001', '+1.446216E+001', '+1.449575E+001', '+1.451489E+001', '+1.452298E+001', '+1.450891E+001', '+1.447875E+001', '+1.443446E+001', '+1.437745E+001', '+1.430042E+001', '+1.421729E+001', '+1.412605E+001', '+1.402558E+001', '+1.391923E+001', '+1.380617E+001', '+1.368942E+001', '+1.356938E+001', '+1.344040E+001', '+1.331113E+001', '+1.317116E+001', '+1.304476E+001', '+1.291496E+001', '+1.277679E+001', '+1.264594E+001', '+1.251228E+001', '+1.237501E+001', '+1.223723E+001', '+1.211293E+001']
self.mplwidgetUp.axes.plot(data1,'#3FF235');
So now my question is how I can add a marker on some value.
To be honest I've tried different stuffs but I delete them and they were a lot of stuffs f.e.
self.mplwidgetUp.axes.plot(data1, marker="o", '#3FF235');
Its giving me an error:
self.mplwidgetUp.axes.plot(data1, marker="o", '#3FF235');
SyntaxError: non-keyword arg after keyword arg
I also've tried with:
self.mplwidgetUp.axes.plot(data1,'#3FF235');
self.mplwidgetUp.axes.plot(data1[270], "ro");
But it is giving me the point somewhere entirely different on the plot(in the lower left corner). Where 270 is the index of the array where is the max value (its an example i dont know exactly where the maximum is till now)
Can someone please help me I am struggling with this problem whole day.
Thank you in advance

Using this syntax:
plot(..., marker="o")
is using a "keyword" argument, as opposed to simply a "positional" argument which has no keyword= at the beginning, as in:
plot(x, y, '#3FF235')
You can mix them both, as long as the "positional" arguments come before the "keyword" arguments. This should work:
plot(x, y, '#3FF235', marker='o')
But this won't:
plot(x, y, marker='o', '#3FF235')
Note that x, y must be two separate arguments. If you want to mark only point 270, you have to do:
plot(270, data1[270], '#3FF235', marker='o')
To show the actual max, use
data1 = np.asarray(data1, float)
maxi = data1.argmax()
plot(maxi, data1[maxi], 'ro') # can combine color and marker in one positional argument

Doesn't the phrase "non-keyword arg after keyword arg" make you want to investigate what that actually means, rather than just try stuff randomly? In general, the Python syntax func(a, b) is fine (no keyword args), and func(a, option=b) is also fine (there's a keyword arg named "option" at the end; but func(option=b, a) is not allowed (it doesn't know how to interpret the non-keyword arg a after the keyword arg option=b). Your missing keyword is, I believe, color.

Related

Dynamic plotting of multiple circles in python (to see the evolution of a certain trajectory)

I am new to python and was wondering how to dynamically plot multiple circles (one by one) to see the evolution of a certain trajectory for example. All I have as information given to me are the coordinates of each circle (it's center) and the radius of the circles (always 110 mm).
I wrote a very simple code to show you what I would like the final product to look like and the Matrix I use for the coordinates of the center of each circles. I don't know how to animate it though. I looked at matplotlib.animation, but can't seem to find a way to print on the same graph multiple circles one by one and follow that evolution.
Thanks to anyone who can help me :)
Here is the simple code I wrote: (you can copy/paste to see output)
import matplotlib.pyplot as plt
M=[[-353.367, 1033.919], [-332.2289, 1022.62], [-308.9693, 1012.15], [-275.6987, 1009.794], [-255.759, 1012.831], [-227.1466, 1022.136], [-205.0762, 1040.001], [-186.8659, 1063.798], [-169.1376, 1095.61], [-164.1178, 1115.52], [-164.6858, 1145.322], [-172.5163, 1173.053], [-190.4497, 1203.225], [-217.9684, 1218.559], [-243.6059, 1226.065], [-268.9684, 1229.198], [-284.552, 1236.618], [-313.0649, 1245.422], [-341.8054, 1240.937], [-373.7917, 1232.477], [-390.5454, 1213.948], [-414.7616, 1177.002], [-431.7343, 1131.7], [-430.5874, 1111.886], [-422.6885, 1080.612], [-406.6531, 1057.562], [-386.0578, 1045.479], [-363.1557, 1032.198], [-334.0824, 1029.815], [-306.1595, 1034.832], [-275.797, 1050.248], [-251.0765, 1063.588], [-234.0385, 1088.162], [-218.9364, 1116.517], [-215.2409, 1142.459], [-216.5757, 1162.321], [-224.0054, 1193.865], [-239.5592, 1210.065], [-256.5946, 1226.277], [-269.817, 1233.805], [-282.3394, 1244.219], [-310.8614, 1250.199], [-325.9461, 1258.774], [-352.6251, 1273.536], [-378.2938, 1278.17], [-392.2101, 1273.354], [-419.7631, 1259.556], [-443.834, 1239.024], [-462.2394, 1213.344], [-473.6183, 1184.354], [-476.9157, 1148.379], [-471.1018, 1132.955], [-464.7671, 1108.116], [-447.4711, 1086.088], [-424.2345, 1070.545], [-394.7679, 1063.421], [-365.0302, 1062.413], [-337.4447, 1070.366], [-313.6294, 1079.923], [-294.4435, 1100.018], [-273.5304, 1131.008], [-262.598, 1146.377], [-259.7155, 1184.271], [-263.7368, 1213.217], [-275.8035, 1238.906], [-294.8008, 1253.269], [-310.6419, 1267.708], [-337.7829, 1278.309], [-363.7509, 1287.402], [-381.0431, 1308.681], [-401.0663, 1319.924], [-422.0269, 1317.162], [-448.6474, 1304.716], [-473.7899, 1285.203], [-496.8754, 1260.192], [-508.5398, 1227.624], [-512.2774, 1187.758], [-507.8042, 1168.757], [-495.4691, 1143.232], [-476.2492, 1122.938], [-447.8833, 1111.69], [-432.8667, 1105.275], [-403.2355, 1104.286], [-383.3333, 1108.894], [-353.2146, 1119.441], [-328.9186, 1138.472], [-314.5862, 1163.125], [-302.3018, 1181.773], [-296.0374, 1201.452], [-295.3168, 1231.432], [-302.4509, 1259.988], [-313.687, 1280.337], [-329.2202, 1301.075], [-357.1423, 1315.207], [-381.2958, 1324.296], [-407.1058, 1341.854], [-419.993, 1363.024], [-430.4856, 1369.453], [-446.1629, 1365.734], [-475.8101, 1352.226], [-498.8694, 1339.29], [-517.2361, 1311.655], [-530.3865, 1294.905], [-533.8939, 1267.289], [-535.2554, 1237.41], [-528.8127, 1214.766], [-516.8326, 1189.832], [-496.7888, 1170.367], [-465.8856, 1158.17], [-438.7599, 1153.918], [-414.804, 1158.549], [-380.3575, 1171.258], [-352.4823, 1191.146], [-332.798, 1216.418], [-321.6086, 1249.139], [-318.3846, 1279.136], [-323.3752, 1307.856], [-338.4404, 1337.587], [-354.3026, 1350.77], [-380.7487, 1364.942], [-406.5152, 1379.089], [-426.5342, 1393.325], [-434.4213, 1411.274], [-440.8358, 1423.097], [-457.6952, 1421.923], [-477.868, 1411.24], [-506.8693, 1392.765], [-528.1245, 1364.994], [-539.1038, 1336.496], [-546.2713, 1316.544], [-545.8773, 1290.688], [-535.0356, 1262.777], [-518.2655, 1229.677], [-486.7253, 1212.485], [-454.5135, 1207.969], [-418.6611, 1212.69], [-390.2291, 1225.6], [-358.2794, 1253.604], [-341.0657, 1280.357], [-329.5321, 1319.843], [-331.4965, 1358.81], [-347.1193, 1387.638], [-374.7163, 1415.354], [-413.9228, 1428.634], [-434.3252, 1449.438], [-436.9276, 1468.692], [-439.6375, 1479.155], [-455.6206, 1474.209], [-489.7198, 1453.96], [-521.986, 1422.663], [-539.7686, 1384.55], [-543.0701, 1354.541], [-537.5444, 1325.794], [-520.8219, 1296.02], [-499.6737, 1277.328], [-471.653, 1263.555], [-428.4604, 1263.644], [-399.12, 1271.29], [-367.6371, 1293.805], [-341.3217, 1326.764], [-327.3464, 1365.63], [-327.6788, 1410.848], [-342.2673, 1444.753], [-364.3698, 1464.017], [-395.0403, 1480.398], [-421.46, 1499.156], [-426.0284, 1523.588], [-415.4504, 1532.763], [-397.0308, 1529.162], [-373.9081, 1516.305], [-341.4985, 1495.441], [-325.3263, 1468.436], [-312.1562, 1423.641], [-311.4977, 1393.881], [-317.5511, 1362.964], [-339.4044, 1336.628], [-371.6758, 1317.971], [-416.1536, 1315.724], [-455.3117, 1327.009], [-483.2677, 1351.7], [-508.9474, 1376.833], [-523.6409, 1411.456], [-526.3406, 1441.475], [-519.9404, 1482.489], [-493.0933, 1511.768], [-469.0362, 1526.164], [-432.756, 1543.481], [-403.2769, 1563.808], [-391.6133, 1579.361], [-366.1702, 1574.822], [-342.1183, 1555.277], [-310.115, 1533.289], [-288.2865, 1496.987], [-280.5991, 1467.129], [-282.1186, 1428.055], [-299.5267, 1394.554], [-319.8267, 1375.856], [-350.9147, 1362.371], [-400.0623, 1364.378], [-430.872, 1380.399], [-465.416, 1413.822], [-491.4677, 1451.262], [-496.9905, 1481.268], [-492.8149, 1514.172], [-471.2688, 1547.293], [-450.6965, 1568.428], [-424.2299, 1581.129], [-384.9122, 1598.29], [-356.1093, 1614.251], [-338.9459, 1617.087], [-314.669, 1606.542], [-284.1367, 1579.615], [-254.9558, 1554.324], [-243.4746, 1525.626], [-240.235, 1485.667], [-250.3822, 1448.694], [-273.6103, 1419.559], [-297.7935, 1405.516], [-329.8026, 1400.002], [-388.7009, 1413.653], [-414.6778, 1432.243], [-436.7974, 1456.532], [-453.1871, 1494.635], [-456.7498, 1538.398], [-445.8698, 1574.179], [-419.0897, 1601.206], [-388.5554, 1615.067], [-354.7166, 1632.194], [-314.4724, 1643.525], [-280.2189, 1641.387], [-251.6241, 1629.778], [-230.1354, 1603.68], [-208.1479, 1577.854], [-193.7817, 1538.851], [-193.3607, 1508.953], [-201.3903, 1477.549], [-223.9322, 1444.292], [-256.7153, 1430.09], [-295.3913, 1426.766], [-334.7743, 1436.521], [-366.4014, 1460.237], [-389.7171, 1484.86], [-406.069, 1523.158], [-408.3097, 1562.998], [-400.4853, 1590.734], [-382.6054, 1620.927], [-351.6727, 1638.374], [-314.2585, 1647.47], [-280.8991, 1656.951], [-235.3465, 1655.062], [-197.5304, 1637.869], [-173.212, 1616.99], [-154.4203, 1587.273], [-139.5245, 1547.907], [-142.0162, 1495.963], [-158.593, 1473.332], [-186.9524, 1450.806], [-217.6703, 1440.713], [-257.2566, 1443.088], [-295.5097, 1459.153], [-327.2386, 1487.681], [-344.2355, 1514.735], [-355.4432, 1554.364], [-354.3744, 1583.898], [-340.4795, 1610.833], [-321.8054, 1639.23], [-288.5625, 1652.806], [-259.8545, 1659.756], [-213.7623, 1660.159], [-173.7876, 1654.228], [-136.6984, 1635.506], [-106.9547, 1605.329], [-90.45823, 1567.705], [-84.31964, 1531.705], [-89.45423, 1502.995], [-102.8442, 1467.743], [-142.8958, 1444.217], [-181.0074, 1440.788], [-218.7369, 1447.717], [-254.862, 1468.821], [-281.443, 1492.04], [-294.3479, 1527.382], [-300.8553, 1549.361], [-298.0456, 1584.913], [-289.9435, 1611.776], [-267.7791, 1633.974], [-242.0123, 1650.594], [-217.7545, 1658.31], [-184.2669, 1654.097], [-144.8474, 1644.531], [-109.7208, 1637.203], [-82.43204, 1621.707], [-59.36412, 1591.363], [-38.09873, 1563.542], [-30.89796, 1533.667], [-33.99216, 1485.436], [-53.55411, 1456.685], [-79.92442, 1435.82], [-107.0308, 1428.931], [-144.5399, 1428.12], [-175.7949, 1438.916], [-202.2502, 1456.225], [-223.8597, 1479.606], [-242.5855, 1517.033], [-247.6185, 1553.075], [-241.5967, 1576.318], [-227.9895, 1610.275], [-204.6221, 1634.386], [-163.3819, 1644.437], [-130.5885, 1633.278], [-98.96542, 1621.423], [-72.5339, 1615.433], [-43.11806, 1597.279], [-5.99537, 1570.966], [10.92261, 1534.209], [18.19289, 1494.239], [10.92241, 1449.578], [-8.584769, 1432.486], [-31.02674, 1410.048], [-69.68215, 1401.698], [-113.4156, 1404.994], [-143.2605, 1419.77], [-162.732, 1440.016], [-185.1952, 1478.715], [-198.0868, 1518.472], [-194.5775, 1547.854], [-180.9837, 1589.557], [-153.4026, 1607.14], [-123.1798, 1617.854], [-87.55124, 1607.125], [-66.58879, 1591.694], [-47.51177, 1581.649], [-15.81822, 1567.318], [21.46709, 1544.121], [46.09593, 1509.497], [57.37705, 1480.045], [57.36242, 1440.343], [44.0697, 1404.997], [18.25326, 1381.899], [-7.351728, 1370.322], [-32.2257, 1364.652], [-66.11478, 1368.577], [-100.2056, 1380.902], [-124.5261, 1403.595], [-145.2667, 1438.634], [-157.1636, 1474.231], [-157.4587, 1513.443], [-145.1665, 1539.583], [-119.9591, 1566.394], [-89.40922, 1580.139], [-53.67052, 1570.516], [-32.64999, 1548.108], [-16.66615, 1536.516], [6.490777, 1529.025], [31.97713, 1514.448], [60.08655, 1484.993], [81.14851, 1453.727], [88.46942, 1423.841], [81.74537, 1375.701], [67.44641, 1351.281], [46.61972, 1332.588], [15.0952, 1320.228], [-12.26343, 1318.346], [-42.129, 1324.324], [-75.54681, 1338.252], [-101.5572, 1367.278], [-118.0977, 1394.486], [-128.0707, 1438.201], [-123.8414, 1472.884], [-108.7894, 1501.175], [-78.72721, 1525.078], [-46.19279, 1533.898], [-23.59591, 1521.328], [-7.722545, 1495.371], [2.110508, 1483.757], [27.42411, 1475.468], [61.11173, 1453.39], [88.5411, 1429.751], [100.7274, 1398.062], [106.1155, 1368.119], [103.9678, 1333.036], [86.48449, 1299.491], [58.09462, 1276.048], [31.18663, 1267.566], [-4.258423, 1266.381], [-33.82413, 1275.022], [-69.1487, 1297.679], [-89.99754, 1330.714], [-107.3487, 1359.621], [-111.1309, 1389.672], [-103.752, 1441.02], [-68.02649, 1469.898], [-34.99534, 1481.813], [-8.461586, 1473.875], [-0.1402668, 1452.983], [2.639243, 1434.012], [9.501756, 1428.734], [35.01265, 1418.973], [60.25186, 1402.637], [82.93935, 1380.076], [103.5159, 1343.29], [110.4929, 1299.416], [104.37, 1265.672], [88.31962, 1249.234], [71.85352, 1226.983], [44.76006, 1218.187], [25.78514, 1211.846], [-4.032246, 1212.962], [-35.28857, 1220.177], [-60.11924, 1236.0], [-78.1687, 1258.27], [-99.41018, 1281.373], [-100.1344, 1281.373], [-102.1007, 1324.693], [-106.4406, 1367.235], [-86.26932, 1399.474], [-60.85463, 1410.725], [-44.8115, 1425.372], [-15.77799, 1422.786], [-3.165829, 1402.704], [-4.200755, 1382.766], [-14.88467, 1374.684], [-37.12067, 1369.416], [-55.75563, 1356.069], [-83.39506, 1335.855], [-102.8612, 1310.411], [-113.7677, 1277.62], [-116.6935, 1247.634], [-111.4152, 1226.374], [-102.5447, 1205.037], [-89.81829, 1182.588], [-62.18055, 1164.957], [-34.44635, 1157.941], [-4.697551, 1158.479], [24.80031, 1166.713], [55.11592, 1189.81], [82.74968, 1214.07], [95.09119, 1242.216], [100.8731, 1278.122], [97.81202, 1307.189], [86.77965, 1333.134], [68.61958, 1354.043], [48.2424, 1369.461], [19.12447, 1372.624], [-0.8152943, 1361.971], [-17.21025, 1340.192], [-32.79333, 1326.46], [-52.63164, 1321.488], [-71.75038, 1307.899], [-102.1292, 1288.402], [-120.6276, 1267.054], [-131.8435, 1248.589], [-137.8415, 1219.025], [-138.2087, 1197.053], [-135.7063, 1170.291], [-122.9438, 1144.966], [-103.781, 1124.957], [-79.13057, 1112.104], [-44.85416, 1107.323], [-20.89322, 1110.864], [11.95125, 1117.725], [32.82501, 1131.874], [47.87254, 1146.108], [64.46723, 1171.654], [76.13985, 1210.502], [76.94341, 1244.263], [69.95406, 1271.886], [53.59194, 1295.287], [28.41202, 1312.713], [5.259316, 1322.112], [-23.90935, 1314.675], [-49.2878, 1295.755], [-65.5571, 1284.006], [-77.68121, 1280.748], [-98.63795, 1271.883], [-128.6358, 1251.447], [-148.9674, 1236.27], [-165.4682, 1209.712], [-172.2538, 1186.354], [-173.92, 1150.461], [-169.078, 1131.317], [-156.4, 1105.401], [-138.3503, 1088.234], [-120.7542, 1072.757], [-87.36267, 1065.241], [-63.5072, 1064.928], [-39.72315, 1073.128], [-3.400684, 1088.865], [16.01539, 1107.792], [30.89093, 1128.555], [40.31864, 1153.436], [43.63892, 1183.407], [38.95707, 1212.601], [27.39531, 1233.896], [15.34975, 1256.269], [-7.563136, 1272.373], [-38.67617, 1279.378], [-66.80437, 1268.137], [-93.26956, 1258.181], [-111.3685, 1247.295], [-145.3048, 1237.571], [-168.5001, 1226.962], [-189.6831, 1208.908], [-198.3916, 1197.501], [-210.5756, 1160.37], [-217.9469, 1130.447], [-214.9319, 1095.652], [-204.0248, 1078.16], [-190.0907, 1059.948], [-170.6554, 1042.757], [-143.9037, 1033.326], [-114.5352, 1031.72], [-84.7283, 1039.733], [-53.30964, 1055.187], [-30.04264, 1077.168], [-12.66869, 1103.878], [-1.486558, 1137.312], [-1.064299, 1157.3], [-5.341586, 1185.994], [-18.21387, 1215.658], [-40.97787, 1228.778], [-54.11655, 1236.161], [-76.08755, 1246.099], [-105.6179, 1244.681], [-135.4744, 1236.043], [-174.7149, 1232.536], [-184.5176, 1225.9], [-220.0076, 1220.869], [-249.2242, 1210.986], [-276.3006, 1191.326], [-301.6652, 1173.228], [-316.6139, 1150.25], [-323.868, 1117.092], [-326.3884, 1097.087], [-322.1166, 1059.155], [-304.9708, 1034.98], [-285.515, 1018.597], [-263.4151, 1006.624], [-234.8072, 1002.626], [-200.9287, 1007.067], [-170.5251, 1019.518], [-150.2951, 1036.233], [-124.2688, 1064.341], [-113.8737, 1093.0], [-109.5216, 1132.898], [-115.8234, 1161.196], [-129.8293, 1185.697], [-153.6055, 1207.544], [-179.8143, 1217.768], [-214.8842, 1221.203], [-244.943, 1224.325], [-269.0096, 1226.253], [-304.297, 1221.33], [-317.3503, 1210.094], [-345.5856, 1190.689], [-362.5714, 1165.841], [-378.0464, 1137.345], [-381.3854, 1113.39], [-379.4114, 1083.903], [-366.9059, 1048.939], [-341.1812, 1028.518], [-317.4363, 1013.372], [-290.7552, 1009.945], [-262.8416, 1011.018], [-239.3678, 1021.605], [-207.5487, 1032.593], [-190.1064, 1054.388], [-173.9324, 1086.723], [-165.1843, 1106.384], [-164.0149, 1146.167], [-172.0801, 1177.211], [-199.4012, 1203.769], [-216.9979, 1220.357], [-260.0022, 1228.974], [-277.6455, 1236.919], [-311.9639, 1245.999], [-346.5475, 1241.313], [-374.5607, 1227.686], [-398.7542, 1207.302], [-417.3307, 1181.762], [-429.835, 1154.858], [-432.4515, 1136.847], [-431.9319, 1112.987], [-423.1529, 1088.577], [-413.3953, 1064.005], [-388.5888, 1045.024], [-362.3439, 1032.438], [-333.2143, 1029.841], [-309.2604, 1033.416], [-284.1591, 1040.317], [-261.3084, 1053.24], [-243.3964, 1075.171], [-225.6251, 1107.614], [-216.5621, 1131.302], [-216.7274, 1167.062], [-225.1822, 1194.614], [-241.3986, 1213.666], [-257.2806, 1232.254], [-283.1432, 1243.899], [-313.6137, 1251.092], [-339.1638, 1264.362], [-357.9759, 1276.749], [-389.4101, 1274.932], [-415.205, 1267.437], [-432.2913, 1245.894], [-457.3329, 1212.539], [-476.3467, 1179.487], [-476.8618, 1149.49], [-470.8127, 1115.837], [-458.1615, 1099.495], [-441.1498, 1079.599], [-409.1117, 1066.836], [-382.1244, 1062.366], [-368.1576, 1063.508], [-329.0669, 1072.368], [-306.1739, 1086.485], [-284.2929, 1108.712], [-271.2411, 1135.612]]
fig, ax = plt.subplots()
for [x,y] in M:
circle = plt.Circle((-x,y), 110, color='r',alpha=0.015)
ax.add_patch(circle)
plt.tight_layout()
plt.grid()
plt.axis([-300, 800, 800, 1800])
plt.show()

Applying a non aggregating function to a groupby pandas object

I have a dataframe (called cep) with two indexes (Cloud and Mode) and data columns. It looks like this :
The data columns are fitted to a linear function and I'm extracting the residuals to the fit in this way :
import pandas as pd
from scipy.optimize import least_squares
args = [-1, 15] # initial guess for the fit
def residuals(args, x, y):
"""
Residual with respect to a linear function
args : list with 2 arguments
x : array
y : array
"""
return args[0] * x + args[1] - y
def residual_function(df):
"""
Returns the array of the residuals
"""
return least_squares(residuals, args, loss='soft_l1', f_scale=0.5, args=(df.logP1, df.W)).fun
cep.groupby(['Cloud', 'Mode']).apply(lambda grp : residual_function(grp))
This gives the expected result :
Now is my issue : I'd like to insert those residual values each in their respective row in the original dataframe to compare them with other columns.
I checked that the returned arrays are of the right length to be inserted but so far I have no idea how to proceed.
I tried to follow tutorials, but the difference with the textbook problem here is that the function I applied does not aggregate the data. Do you have some hints?
Small sample data here :
Mode;Cloud;W;logP1
F;LMC;14,525;0,4939
F;LMC;13,4954;0,7491
F;LMC;14,5421;0,4249
F;LMC;12,033;1,0215
F;LMC;14,3422;0,5655
F;LMC;13,937;0,6072
F;LMC;13,53;0,737
F;LMC;15,2106;0,2309
F;LMC;14,0813;0,5721
F;LMC;14,5128;0,41
F;LMC;14,1059;0,5469
F;LMC;15,6032;0,1014
F;LMC;13,1088;0,8562
F;LMC;12,3528;1,0513
F;LMC;13,1629;0,8416
F;LMC;14,3114;0,4867
F;LMC;14,4013;0,498
F;LMC;13,5057;0,7131
F;LMC;14,3626;0,464
F;LMC;14,5973;0,4111
F;LMC;13,9286;0,6059
F;LMC;15,066;0,2711
F;LMC;12,7364;0,9466
F;LMC;13,3753;0,7442
F;LMC;13,9748;0,5854
F;LMC;12,8836;0,8946
F;LMC;14,4912;0,4206
F;LMC;14,4131;0,4567
F;LMC;12,183;1,1382
F;LMC;14,5492;0,3686
F;LMC;14,1482;0,5339
F;LMC;13,7062;0,7116
F;LMC;13,0731;0,8682
F;LMC;11,5609;1,353
F;LMC;13,9453;0,5551
F;LMC;14,0072;0,6715
F;LMC;13,9838;0,6021
F;LMC;13,9974;0,5562
F;LMC;14,3898;0,5069
F;LMC;14,4497;0,4433
F;LMC;14,3524;0,5064
F;LMC;12,9604;0,9134
F;LMC;12,9757;0,8548
F;LMC;14,2783;0,4927
F;LMC;13,7148;0,6758
F;LMC;14,2348;0,5142
F;LMC;12,6793;0,9415
F;LMC;14,2241;0,5738
F;LMC;14,472;0,4554
F;LMC;15,1508;0,2076
F;LMC;12,5414;1,0159
F;LMC;14,2102;0,5334
F;LMC;15,6086;0,1116
F;LMC;13,2986;0,8381
F;LMC;13,0136;0,8864
F;LMC;13,9774;0,585
F;LMC;14,4256;0,533
F;LMC;14,3582;0,4578
F;LMC;14,3258;0,4859
F;LMC;14,6646;0,3757
F;LMC;12,733;0,9901
F;LMC;14,6296;0,3839
F;LMC;14,054;0,5766
F;LMC;14,3194;0,4884
F;LMC;12,6602;0,9715
F;LMC;13,5909;0,5675
F;LMC;13,9268;0,6196
F;LMC;12,5813;0,9935
F;LMC;13,0824;0,8591
F;LMC;13,5097;0,7375
F;LMC;13,1938;0,5053
F;LMC;14,7357;0,3253
F;LMC;14,0624;0,6009
F;LMC;14,1528;0,533
F;LMC;14,6709;0,4007
F;LMC;14,2378;0,4875
F;LMC;11,951;1,2004
F;LMC;14,4555;0,4777
F;LMC;14,4001;0,4404
F;LMC;13,7707;0,6311
F;LMC;14,578;0,4175
F;LMC;15,8662;0,0159
F;LMC;14,055;0,5687
F;LMC;13,6238;0,7307
F;LMC;15,2572;0,2171
F;LMC;13,4022;0,7723
F;LMC;14,2392;0,5256
F;LMC;14,2505;0,4977
F;LMC;14,7174;0,3614
F;LMC;14,487;0,418
F;LMC;14,9309;0,3086
F;LMC;13,8352;0,6334
F;LMC;14,5598;0,41
F;LMC;14,5614;0,422
F;LMC;14,1486;0,5149
F;LMC;14,0304;0,4945
F;LMC;13,5781;0,6801
F;LMC;14,79;0,3218
F;LMC;12,376;1,0908
F;LMC;15,3215;0,2176
F;LMC;14,7264;0,3845
F;LMC;14,6276;0,4057
F;LMC;14,1712;0,5313
F;LMC;14,4153;0,483
F;LMC;12,905;0,9356
F;LMC;14,442;0,4309
F;LMC;12,8702;0,9159
F;LMC;12,8963;0,5775
F;LMC;13,8304;0,6467
F;LMC;14,4665;0,4165
F;LMC;13,0756;0,5794
F;LMC;13,841;0,6593
F;LMC;14,0924;0,5671
F;LMC;13,7546;0,6778
F;LMC;14,2828;0,5181
F;LMC;14,2424;0,5082
F;LMC;14,659;0,3989
F;LMC;13,7528;0,6768
F;LMC;13,7743;0,6368
F;LMC;13,2894;0,791
F;LMC;14,7512;0,3187
F;LMC;14,5241;0,4452
F;LMC;14,301;0,5121
F;LMC;13,334;0,7945
F;LMC;13,5052;0,7012
F;LMC;14,3664;0,4549
F;LMC;14,8614;0,3278
F;LMC;13,8612;0,582
F;LMC;14,2668;0,5158
F;LMC;14,3937;0,4457
F;LMC;14,0226;0,582
F;LMC;14,387;0,5565
F;LMC;14,3198;0,4362
F;LMC;14,4404;0,4701
F;LMC;14,2774;0,4939
F;LMC;13,7678;0,6557
F;LMC;14,3212;0,4882
F;LMC;14,6453;0,3696
F;LMC;13,9064;0,6084
F;LMC;13,5167;0,7581
F;LMC;14,1692;0,5134
F;LMC;14,6714;0,4136
F;LMC;14,4332;0,4507
F;LMC;14,705;0,3631
F;LMC;13,6728;0,496
F;LMC;15,358;0,1651
F;LMC;13,7592;0,6278
F;LMC;14,0626;0,5754
F;LMC;13,1127;0,8692
F;LMC;14,2108;0,498
F;LMC;14,4519;0,4449
F;LMC;14,0041;0,5666
F;LMC;14,157;0,5392
F;LMC;14,254;0,5245
F;LMC;15,4844;0,1838
F;LMC;14,0845;0,5626
F;LMC;13,0861;0,838
F;LMC;13,3144;0,831
F;LMC;14,2535;0,4911
F;LMC;14,0256;0,5723
F;LMC;14,3246;0,4938
F;LMC;14,4412;0,4136
F;LMC;14,1043;0,518
F;LMC;14,7512;0,3772
F;LMC;14,3982;0,5039
F;LMC;14,2701;0,5042
F;LMC;13,9166;0,5941
F;LMC;13,0324;0,837
F;LMC;13,4839;0,6331
F;LMC;13,4491;0,7443
F;LMC;14,4702;0,458
F;LMC;14,4814;0,4595
F;LMC;14,3008;0,4575
F;LMC;14,922;0,3313
F;LMC;14,6542;0,4263
F;LMC;14,5007;0,4838
F;LMC;14,4335;0,4829
F;LMC;14,4737;0,4586
F;LMC;14,2537;0,5442
F;LMC;14,038;0,5473
F;LMC;14,1413;0,5523
F;LMC;14,669;0,3505
F;LMC;12,3572;1,1033
F;LMC;13,868;0,6416
F;LMC;13,4292;0,816
F;LMC;11,6771;1,3442
F;LMC;14,5086;0,4654
F;LMC;14,3588;0,4807
F;LMC;14,6915;0,3674
F;LMC;15,6488;0,0647
F;LMC;12,4187;0,9791
F;LMC;14,1555;0,5235
F;LMC;14,5765;0,4281
F;LMC;14,3579;0,4596
F;LMC;13,0932;0,7957
F;LMC;14,4552;0,4216
F;LMC;13,2221;0,8505
F;LMC;14,4465;0,4466
F;LMC;14,2439;0,5032
F;LMC;14,9606;0,6308
F;LMC;14,4774;0,4424
F;LMC;14,1875;0,5361
F;LMC;13,3982;0,7644
F;LMC;13,0973;0,8595
F;LMC;13,8264;0,6334
F;LMC;13,9296;0,6164
F;LMC;14,5778;0,4033
F;LMC;13,579;0,726
F;LMC;14,0054;0,5779
F;LMC;14,1219;0,5451
F;LMC;14,3512;0,4808
F;LMC;14,5058;0,4199
F;LMC;14,598;0,4201
F;LMC;14,9516;0,2498
F;LMC;13,9944;0,6075
F;LMC;13,9462;0,557
F;LMC;14,2576;0,5148
F;LMC;14,9814;0,2929
F;LMC;14,3851;0,4573
F;LMC;14,3474;0,4606
F;LMC;14,4929;0,3882
F;LMC;14,5201;0,4234
F;LMC;13,7677;0,6548
F;LMC;14,3146;0,4695
F;LMC;14,2846;0,507
F;LMC;14,0967;0,5525
F;LMC;14,7976;0,3546
F;LMC;13,7497;0,6362
F;LMC;14,4647;0,4363
F;LMC;14,1924;0,5293
F;LMC;14,588;0,4089
F;LMC;13,4896;0,7329
F;LMC;14,695;0,3737
F;LMC;14,2672;0,4857
F;LMC;14,0784;0,5848
F;LMC;13,879;0,5743
F;LMC;14,2214;0,4988
F;LMC;12,922;0,8487
F;LMC;14,189;0,5238
F;LMC;13,9938;0,5713
F;LMC;14,379;0,4771
F;LMC;11,2308;1,3564
F;LMC;14,4472;0,4205
F;LMC;14,3739;0,4699
F;LMC;14,393;0,4416
F;LMC;13,9108;0,5927
F;LMC;14,0298;0,6058
F;LMC;15,1538;0,1961
F;LMC;13,0393;0,8731
F;LMC;13,7144;0,645
F;LMC;14,2682;0,487
F;LMC;14,3506;0,4927
F;LMC;14,0472;0,5619
F;LMC;15,1418;0,2506
F;LMC;13,1227;0,5998
F;LMC;13,5646;0,7193
F;LMC;14,5872;0,4357
F;LMC;14,2636;0,5007
F;LMC;13,9564;0,5599
F;LMC;12,8576;0,946
F;LMC;12,3042;1,1454
F;LMC;11,8416;1,3675
F;LMC;13,5498;0,7219
F;LMC;12,1976;1,1581
F;LMC;13,8632;0,6202
F;LMC;14,2952;0,4807
F;LMC;14,4349;0,4437
F;LMC;14,2392;0,5445
F;LMC;13,7248;0,7213
F;LMC;14,3395;0,5117
F;LMC;15,3588;0,2253
F;LMC;12,8509;0,9229
F;LMC;15,5192;0,1453
F;LMC;14,2072;0,4975
F;LMC;14,3524;0,4945
F;LMC;14,5152;0,4488
F;LMC;14,5106;0,4558
F;LMC;14,5759;0,3786
F;LMC;11,196;1,2374
F;LMC;14,3736;0,4788
F;LMC;14,1726;0,528
F;LMC;11,7899;1,1995
F;LMC;12,1062;1,1823
F;LMC;13,7113;0,6714
F;LMC;14,3512;0,4815
F;LMC;13,1016;0,8181
F;LMC;14,4968;0,562
F;LMC;12,4557;1,0671
F;LMC;14,0573;0,551
F;LMC;14,5916;0,4066
F;LMC;14,3214;0,488
F;LMC;13,5498;0,4885
F;LMC;14,4679;0,4273
F;LMC;14,2426;0,4816
F;LMC;13,5759;0,7052
F;LMC;14,0081;0,5769
F;LMC;14,0828;0,5379
F;LMC;12,4168;0,7578
F;LMC;14,1624;0,5052
F;LMC;13,8029;0,6621
F;LMC;14,1944;0,5145
F;LMC;13,7944;0,6184
F;LMC;15,0234;0,3158
F;LMC;13,0961;0,8282
F;LMC;13,976;0,5889
F;LMC;14,3236;0,4847
F;LMC;14,2618;0,4691
F;LMC;13,4528;0,7349
F;LMC;14,2846;0,507
F;LMC;14,4115;0,446
F;LMC;14,2199;0,5336
F;LMC;14,456;0,4423
F;LMC;14,2938;0,488
F;LMC;14,4109;0,4606
F;LMC;14,2599;0,497
F;LMC;13,9034;0,6384
F;LMC;13,6126;0,7075
F;LMC;14,5036;0,4218
F;LMC;14,0065;0,5741
F;LMC;14,8622;0,3404
F;LMC;14,635;0,3683
F;LMC;14,222;0,5454
F;LMC;14,1501;0,5548
F;LMC;14,0822;0,5705
F;LMC;13,5036;0,7267
F;LMC;14,5528;0,4161
F;LMC;14,3332;0,4614
F;LMC;14,1511;0,5471
F;LMC;14,6113;0,3934
F;LMC;14,2998;0,5031
F;LMC;14,1807;0,5352
F;LMC;13,5114;0,7013
F;LMC;12,2096;1,1344
F;LMC;14,3799;0,4304
F;LMC;12,4526;1,1135
F;LMC;14,5042;0,447
F;LMC;13,4594;0,7336
F;LMC;13,2066;0,8423
F;LMC;14,3734;0,4711
F;LMC;13,945;0,5953
F;LMC;12,9938;0,8969
F;LMC;13,4993;0,7034
F;LMC;13,9466;0,5678
F;LMC;14,1772;0,5077
F;LMC;13,5566;0,6949
F;LMC;14,021;0,5811
F;LMC;14,0264;0,646
F;LMC;12,0242;1,1666
F;LMC;14,3106;0,5027
F;LMC;14,9838;0,3164
F;LMC;14,1718;0,5266
F;LMC;14,2606;0,489
F;LMC;12,6479;1,0206
F;LMC;12,9768;0,8684
F;LMC;14,0837;0,5785
F;LMC;13,7944;0,6609
F;LMC;13,532;0,6911
F;LMC;14,835;0,3375
F;LMC;13,7378;0,6941
F;LMC;14,3618;0,4658
F;LMC;12,4782;1,0176
F;LMC;14,2216;0,4981
F;LMC;14,3958;0,4917
F;LMC;11,3796;1,3161
F;LMC;13,8073;0,6301
F;LMC;14,414;0,4601
F;LMC;12,4266;1,086
F;LMC;14,7974;0,3547
F;LMC;14,3369;0,5189
F;LMC;14,3202;0,4874
F;LMC;14,4614;0,4664
F;LMC;13,8344;0,6339
F;LMC;14,0452;0,5896
F;LMC;11,9134;1,161
F;LMC;14,2492;0,4891
F;LMC;14,1338;0,5139
F;LMC;14,439;0,4476
F;LMC;14,1446;0,5322
F;LMC;14,102;0,549
F;LMC;14,5043;0,4421
F;LMC;14,388;0,4511
F;LMC;12,3812;1,0331
F;LMC;14,5086;0,4294
F;LMC;13,6822;0,671
F;LMC;12,3012;1,0862
F;LMC;14,0848;0,534
F;LMC;14,3381;0,4886
F;LMC;14,5544;0,3908
F;LMC;14,216;0,5226
F;LMC;14,5028;0,4323
F;LMC;12,7769;0,9244
F;LMC;13,6262;0,6984
F;LMC;14,5276;0,4107
F;LMC;13,921;0,5835
F;LMC;14,6279;0,396
F;LMC;14,6304;0,3796
F;LMC;14,2079;0,4722
F;LMC;12,4538;1,0356
F;LMC;14,2662;0,4876
F;LMC;13,8493;0,6217
F;LMC;12,9806;0,8385
F;LMC;14,3148;0,4768
F;LMC;14,2225;0,49
F;LMC;14,3932;0,4084
F;LMC;13,6934;0,5829
F;LMC;14,1702;0,5297
F;LMC;11,7812;1,2435
F;LMC;14,2866;0,4778
F;LMC;15,2824;0,1739
F;LMC;14,451;0,4485
F;LMC;14,4842;0,4222
F;LMC;14,3422;0,449
F;LMC;14,4408;0,4435
F;LMC;12,527;1,0298
F;LMC;12,3746;1,1016
F;LMC;11,4802;1,3276
F;LMC;14,47;0,4643
F;LMC;14,1469;0,5183
F;SMC;14,423;0,4796
F;SMC;15,5626;0,2344
F;SMC;15,6889;0,236
F;SMC;15,3574;0,2926
F;SMC;15,8049;0,1015
F;SMC;12,9034;0,9993
F;SMC;14,0039;0,6867
F;SMC;15,9834;0,1812
F;SMC;15,7707;0,2028
F;SMC;15,777;0,1735
F;SMC;14,7121;0,4973
F;SMC;13,8691;0,7188
F;SMC;14,889;0,4123
F;SMC;14,5322;0,6233
F;SMC;15,6791;0,331
F;SMC;13,9406;0,7262
F;SMC;13,728;0,8514
F;SMC;15,1952;0,3583
F;SMC;16,0921;0,1397
F;SMC;15,6162;0,1532
F;SMC;15,786;0,2563
F;SMC;16,0774;0,1197
F;SMC;14,4397;0,599
F;SMC;15,8693;0,2072
F;SMC;15,6668;0,2452
F;SMC;15,1954;0,3509
F;SMC;14,1387;0,669
F;SMC;15,6928;0,2125
F;SMC;14,6266;0,5017
F;SMC;15,9557;0,1772
F;SMC;15,607;0,2501
F;SMC;15,9632;0,1629
F;SMC;15,7932;0,2325
F;SMC;15,7108;0,1534
F;SMC;13,037;0,9898
F;SMC;15,3998;0,2915
F;SMC;15,1724;0,3675
F;SMC;13,7222;0,7848
F;SMC;14,8296;0,5222
F;SMC;15,704;0,2407
F;SMC;13,5231;0,8378
F;SMC;14,4338;0,5303
F;SMC;14,6202;0,4843
F;SMC;16,2836;0,0473
F;SMC;15,6011;0,1758
F;SMC;16,0037;0,1571
F;SMC;13,9062;0,6286
F;SMC;16,0606;0,0557
F;SMC;13,2924;0,8905
F;SMC;15,9942;0,1997
F;SMC;15,7766;0,2395
F;SMC;10,8462;1,6309
F;SMC;15,956;0,1425
F;SMC;13,857;0,7079
F;SMC;15,3619;0,2696
F;SMC;14,0064;0,6903
F;SMC;15,6531;0,2602
F;SMC;14,9001;0,5001
F;SMC;14,3957;0,6156
F;SMC;15,4414;0,3174
F;SMC;15,8321;0,1822
F;SMC;16,3562;0,1385
F;SMC;15,8812;0,1651
F;SMC;15,1404;0,408
F;SMC;13,7978;0,8055
F;SMC;15,9291;0,132
F;SMC;15,0555;0,507
F;SMC;15,5766;0,2596
F;SMC;13,6006;0,8469
F;SMC;16,455;0,0629
F;SMC;15,8762;0,1072
F;SMC;16,2856;0,0768
F;SMC;15,8521;0,2129
F;SMC;15,7685;0,2374
F;SMC;16,1197;0,1043
F;SMC;16,0851;0,2333
F;SMC;15,8126;0,1777
F;SMC;14,3891;0,6065
F;SMC;14,6419;0,5446
F;SMC;15,3942;0,3101
F;SMC;15,5785;0,2494
F;SMC;15,661;0,2227
F;SMC;15,9648;0,1405
F;SMC;12,7911;1,0845
F;SMC;15,9351;0,1575
F;SMC;14,1764;0,6864
F;SMC;15,153;0,3624
F;SMC;15,9336;0,1232
F;SMC;15,0124;0,3796
F;SMC;16,1231;0,106
F;SMC;14,4362;0,5306
F;SMC;13,1883;0,8354
F;SMC;15,8972;0,1757
F;SMC;14,1612;0,7287
F;SMC;15,3792;0,2869
F;SMC;16,421;0,0329
F;SMC;14,833;0,4543
F;SMC;14,3997;0,5912
F;SMC;15,8797;0,1747
F;SMC;16,0337;0,1565
F;SMC;15,7371;0,2251
F;SMC;13,954;0,7293
F;SMC;14,1691;0,6695
F;SMC;15,6208;0,2211
F;SMC;14,3416;0,6492
F;SMC;14,6636;0,5423
F;SMC;16,0386;0,1506
F;SMC;14,6578;0,5604
F;SMC;15,6368;0,24
F;SMC;14,843;0,4738
F;SMC;14,9818;0,4869
F;SMC;12,4251;1,1641
F;SMC;15,0727;0,4671
F;SMC;14,1448;0,5949
F;SMC;15,2148;0,3644
F;SMC;15,9372;0,117
F;SMC;15,4336;0,3018
F;SMC;14,5416;0,557
F;SMC;16,4654;0,0436
F;SMC;14,934;0,5498
F;SMC;14,3896;0,695
F;SMC;15,3896;0,3492
F;SMC;15,8122;0,1602
F;SMC;13,7822;0,704
F;SMC;15,7938;0,1679
F;SMC;15,4049;0,3059
F;SMC;16,0742;0,1187
F;SMC;15,704;0,2036
F;SMC;14,9947;0,3748
F;SMC;15,1374;0,4001
F;SMC;13,2254;0,7136
F;SMC;14,3267;0,577
F;SMC;12,7772;1,0317
F;SMC;15,5302;0,3074
F;SMC;16,12;0,1395
F;SMC;15,9826;0,1873
F;SMC;15,9196;0,2025
F;SMC;15,5396;0,2888
F;SMC;14,0063;0,7543
F;SMC;14,6752;0,542
F;SMC;14,3782;0,6365
F;SMC;15,8015;0,2321
F;SMC;15,4898;0,0235
F;SMC;15,6376;0,2499
F;SMC;15,527;0,2697
F;SMC;15,2883;0,3324
F;SMC;15,1014;0,3996
F;SMC;14,435;0,5827
F;SMC;16,1522;0,0832
F;SMC;13,3787;0,8974
F;SMC;16,6258;0,0226
F;SMC;14,0421;0,8043
F;SMC;15,4764;0,2719
F;SMC;14,1377;0,6069
F;SMC;15,3654;0,3461
F;SMC;16,3063;0,0677
F;SMC;15,5912;0,2227
F;SMC;14,555;0,5143
F;SMC;16,2947;0,0824
F;SMC;15,2208;0,3488
F;SMC;16,8052;-0,0287
F;SMC;15,8592;0,1835
F;SMC;15,6349;0,2632
F;SMC;16,522;0,0581
F;SMC;15,7794;0,3351
F;SMC;16,095;0,1574
F;SMC;16,0564;0,1818
F;SMC;16,4614;0,0897
F;SMC;16,1351;0,1332
F;SMC;14,4711;0,5808
F;SMC;13,8768;0,6795
F;SMC;16,2458;0,1273
F;SMC;16,1994;0,0372
F;SMC;15,3434;0,3072
F;SMC;15,5384;0,2442
F;SMC;14,5322;0,5703
F;SMC;15,7762;0,3507
F;SMC;14,3793;0,5628
F;SMC;15,4777;0,3139
F;SMC;15,9216;0,1764
F;SMC;14,3758;0,5278
F;SMC;15,2363;0,3313
F;SMC;14,3224;0,3258
F;SMC;15,2266;0,3656
F;SMC;15,6305;0,174
F;SMC;14,046;0,7832
F;SMC;14,8704;0,507
F;SMC;16,0267;0,2357
F;SMC;16,0671;0,154
F;SMC;13,8434;0,6901
F;SMC;14,4167;0,5992
F;SMC;15,9808;0,125
F;SMC;16,0696;0,1131
F;SMC;15,166;0,166
F;SMC;14,1023;0,6447
F;SMC;13,9666;0,6979
F;SMC;15,64;0,2577
F;SMC;15,6974;0,2429
F;SMC;15,1257;0,3877
F;SMC;15,186;0,3295
F;SMC;14,87;0,4651
F;SMC;16,0943;0,1807
F;SMC;15,7421;0,1809
F;SMC;14,6085;0,5253
F;SMC;14,6912;0,4777
F;SMC;14,1322;0,71
F;SMC;15,3319;0,2937
F;SMC;14,9283;0,4639
F;SMC;15,3753;0,2732
F;SMC;15,0886;0,3989
F;SMC;15,3778;0,3028
F;SMC;16,4933;0,0274
F;SMC;14,7944;0,4336
F;SMC;13,7806;0,7397
F;SMC;14,1895;0,6325
F;SMC;15,947;0,1084
F;SMC;15,9606;0,1665
F;SMC;15,417;0,0976
F;SMC;15,2905;0,3652
F;SMC;14,7712;0,4453
F;SMC;14,6692;0,5412
F;SMC;16,1936;0,0286
F;SMC;15,6136;0,2097
F;SMC;15,8061;0,078
F;SMC;15,3243;0,3385
F;SMC;15,2366;0,3669
F;SMC;16,1653;0,0573
F;SMC;15,916;0,1591
F;SMC;15,2422;0,3216
F;SMC;12,2583;1,2107
F;SMC;15,6361;0,1766
F;SMC;16,0818;0,1771
F;SMC;15,6966;0,2147
F;SMC;16,193;0,0657
F;SMC;14,8256;0,4574
F;SMC;15,7214;0,2185
F;SMC;15,5803;0,2725
F;SMC;14,7322;0,4754
F;SMC;15,8964;0,1898
F;SMC;14,5428;0,4732
F;SMC;16,1362;0,1396
F;SMC;16,2832;0,0473
F;SMC;15,6508;0,2232
F;SMC;14,725;0,4998
F;SMC;16,1585;0,1106
F;SMC;15,2284;0,3727
F;SMC;15,1728;0,3718
F;SMC;14,5354;0,5431
F;SMC;15,8224;0,1256
F;SMC;15,5462;0,2633
F;SMC;14,942;0,455
F;SMC;16,02;0,1426
F;SMC;15,2292;0,2965
F;SMC;14,6639;0,4402
F;SMC;14,887;0,4365
F;SMC;15,8288;0,1924
F;SMC;14,4903;0,5274
F;SMC;15,9464;0,1638
F;SMC;15,8069;0,1999
F;SMC;14,9924;0,3985
F;SMC;15,6917;0,1355
F;SMC;15,5414;0,1628
F;SMC;15,6168;0,2157
F;SMC;15,8006;0,177
F;SMC;14,9294;0,4732
F;SMC;14,5272;0,599
F;SMC;15,7318;0,2691
F;SMC;14,5181;0,5782
F;SMC;15,8524;0,2074
F;SMC;13,773;0,747
F;SMC;15,7608;0,1586
F;SMC;13,947;0,688
F;SMC;14,9774;0,4224
F;SMC;14,5288;0,4912
F;SMC;12,4944;1,2355
F;SMC;13,8683;0,6944
F;SMC;15,7118;0,186
F;SMC;15,7392;0,2081
F;SMC;12,292;1,1395
F;SMC;14,7918;0,4632
F;SMC;15,4428;0,3367
F;SMC;14,7542;0,4279
F;SMC;15,2914;0,3575
F;SMC;14,7332;0,4836
F;SMC;14,566;0,5553
F;SMC;15,9406;0,1167
F;SMC;15,6304;0,2296
F;SMC;14,0478;0,7063
F;SMC;15,5402;0,2821
F;SMC;15,6019;0,2443
F;SMC;15,6554;0,1979
F;SMC;14,7736;0,1631
F;SMC;16,1684;0,119
F;SMC;14,5113;0,5073
F;SMC;15,5466;0,134
F;SMC;15,1128;0,3919
F;SMC;13,4782;0,8109
F;SMC;15,8534;0,2208
F;SMC;13,1824;0,9072
F;SMC;15,8466;0,1901
1;LMC;13,9452;0,4076
1;LMC;14,3302;0,3149
1;LMC;12,9682;0,6984
1;LMC;15,0586;0,1023
1;LMC;14,328;0,304
1;LMC;15,024;0,0882
1;LMC;14,0594;0,3924
1;LMC;17,2026;-0,5304
1;LMC;14,327;0,3192
1;LMC;13,8748;0,4361
1;LMC;17,155;-0,4783
1;LMC;14,3154;0,3197
1;LMC;14,3376;0,2943
1;LMC;14,462;0,3461
1;LMC;14,139;0,3647
1;LMC;16,764;-0,4451
1;LMC;15,1618;0,1008
1;LMC;14,2229;0,3328
1;LMC;13,8046;0,4946
1;LMC;14,4268;0,2703
1;LMC;15,5032;-0,0368
1;LMC;15,9052;-0,1647
1;LMC;13,908;0,4434
1;LMC;14,3352;0,2986
1;LMC;13,6286;0,5326
1;LMC;13,7934;0,4842
1;LMC;14,3979;0,2817
1;LMC;14,0496;0,4238
1;LMC;14,4368;0,2939
1;LMC;14,3242;0,3164
1;LMC;12,6825;0,7719
1;LMC;13,846;0,4483
1;LMC;14,5746;0,2727
1;LMC;14,5171;0,2641
1;LMC;14,9218;0,1209
1;LMC;14,2248;0,3411
1;LMC;14,3478;0,3109
1;LMC;14,0999;0,357
1;LMC;14,5558;0,2632
1;LMC;13,7602;0,4936
1;LMC;14,5354;0,2775
1;LMC;13,5663;0,5364
1;LMC;17,0694;-0,4754
1;LMC;14,2915;0,3346
1;LMC;14,7311;0,218
1;LMC;13,6888;0,5417
1;LMC;14,627;0,2133
1;LMC;13,4404;0,597
1;LMC;14,7168;0,2212
1;LMC;15,0594;0,3161
1;LMC;15,0425;0,1061
1;LMC;16,815;-0,4438
1;LMC;16,001;-0,1914
1;LMC;14,4216;0,2488
1;LMC;14,4748;0,286
1;LMC;13,8631;0,466
1;LMC;14,676;0,2098
1;LMC;14,4089;0,3046
1;LMC;14,2384;0,3559
1;LMC;14,2154;0,3397
1;LMC;14,059;0,3829
1;LMC;14,7006;0,2089
1;LMC;13,2151;0,6923
1;LMC;14,5228;0,2442
1;LMC;14,1972;0,3233
1;LMC;14,7161;0,2052
1;LMC;14,4328;0,2944
1;LMC;14,4018;0,2906
1;LMC;14,7142;0,2083
1;LMC;14,5522;0,2311
1;LMC;13,6784;0,5121
1;LMC;14,396;0,31
1;LMC;14,5408;0,2582
1;LMC;13,9204;0,4699
1;LMC;14,3842;0,308
1;LMC;13,9161;0,4451
1;LMC;14,5161;0,2751
1;LMC;16,6794;-0,4003
1;LMC;14,2213;0,3356
1;LMC;14,0804;0,3867
1;LMC;14,3438;0,2957
1;LMC;16,7434;-0,4476
1;LMC;14,4333;0,2808
1;LMC;14,3312;0,2889
1;LMC;14,504;0,247
1;LMC;13,2101;0,6412
1;LMC;13,8247;0,4442
1;LMC;13,962;0,4153
1;LMC;14,0806;0,3598
1;LMC;14,4793;0,2675
1;LMC;14,8813;0,1499
1;LMC;14,5757;0,2212
1;LMC;14,409;0,2996
1;LMC;13,8864;0,4335
1;LMC;14,1462;0,3252
1;LMC;13,4634;0,5562
1;LMC;14,034;0,4077
1;LMC;17,5882;-0,6029
1;LMC;13,7698;0,4653
1;LMC;14,3287;0,3083
1;LMC;13,2086;0,6234
1;LMC;13,5732;0,546
1;LMC;15,48;-0,014
1;LMC;13,1248;0,6751
1;LMC;17,1166;-0,528
1;LMC;13,9133;0,4573
1;LMC;15,0072;0,1038
1;LMC;14,1087;0,3766
1;LMC;17,1206;-0,5551
1;LMC;14,6866;0,2054
1;LMC;13,4114;0,5868
1;LMC;15,8548;-0,1511
1;LMC;12,2802;0,6877
1;LMC;17,1984;-0,5196
1;LMC;13,2713;0,6421
1;LMC;14,537;0,2466
1;LMC;15,4264;0,0006
1;LMC;15,5466;-0,0351
1;LMC;14,5549;0,3135
1;LMC;14,8506;0,1502
1;LMC;15,1214;0,0971
1;LMC;14,0284;0,3934
1;LMC;13,0608;0,6455
1;LMC;14,4624;0,2676
1;LMC;15,2442;0,0527
1;LMC;13,9045;0,4276
1;LMC;14,0536;0,3947
1;LMC;14,0503;0,3833
1;LMC;14,2145;0,3506
1;LMC;14,3653;0,2799
1;LMC;12,2534;0,6564
1;LMC;13,4538;0,5395
1;LMC;16,7458;-0,3898
1;LMC;13,799;0,4515
1;LMC;14,3382;0,2787
1;LMC;13,6368;0,5072
1;LMC;13,4912;0,5308
1;LMC;14,8163;0,1739
1;LMC;13,8256;0,4412
1;LMC;14,3908;0,2858
1;LMC;14,9267;0,0972
1;LMC;14,5064;0,2072
1;LMC;13,899;0,4303
1;LMC;14,0764;0,3825
1;LMC;14,871;0,1848
1;LMC;14,8902;0,1544
1;LMC;14,1546;0,3697
1;LMC;14,7806;0,1531
1;LMC;15,3816;0,0162
1;LMC;14,1212;0,3378
1;LMC;14,6768;0,1847
1;LMC;14,229;0,3145
1;LMC;14,3439;0,2859
1;LMC;14,5225;0,183
1;LMC;14,222;0,3029
1;LMC;14,6786;0,2644
1;LMC;14,2882;0,3067
1;LMC;17,304;-0,4965
1;LMC;13,2234;0,6359
1;LMC;14,1998;0,341
1;LMC;16,9782;-0,4488
1;SMC;14,2801;0,5215
1;SMC;16,7184;-0,1413
1;SMC;15,6902;0,0745
1;SMC;16,1686;-0,057
1;SMC;14,6436;0,3746
1;SMC;16,573;-0,1489
1;SMC;15,4925;0,1575
1;SMC;15,0159;0,3255
1;SMC;15,5657;0,1226
1;SMC;14,3219;0,4484
1;SMC;16,5712;-0,1446
1;SMC;16,1988;-0,0829
1;SMC;15,4376;0,1613
1;SMC;13,6344;0,5874
1;SMC;14,3778;0,4716
1;SMC;14,2394;0,5057
1;SMC;15,8777;0,0206
1;SMC;16,7138;-0,1735
1;SMC;15,7367;0,0683
1;SMC;14,7922;0,3067
1;SMC;17,9934;-0,5486
1;SMC;14,1358;0,5249
1;SMC;14,8562;0,3176
1;SMC;15,5588;0,1312
1;SMC;14,3;0,5272
1;SMC;15,6038;0,0537
1;SMC;14,5812;0,4347
1;SMC;14,8804;0,3115
1;SMC;14,3614;0,4934
1;SMC;16,4298;-0,0449
1;SMC;15,8712;0,0365
1;SMC;14,3527;0,5141
1;SMC;15,639;0,0993
1;SMC;14,0709;0,4997
1;SMC;16,0837;0,0029
1;SMC;14,7445;0,4165
1;SMC;16,23;-0,0246
1;SMC;15,1252;0,2608
1;SMC;16,255;-0,043
1;SMC;15,4152;0,2079
1;SMC;15,6954;0,0998
1;SMC;14,8665;0,3692
1;SMC;15,7832;0,0378
1;SMC;14,8404;-0,2293
1;SMC;15,9228;0,0104
1;SMC;16,1484;0,0015
1;SMC;15,8728;0,0054
1;SMC;14,8986;0,2908
1;SMC;16,731;-0,2169
1;SMC;15,2766;0,1077
1;SMC;15,5933;0,0706
1;SMC;14,6399;0,3879
1;SMC;16,4613;-0,0989
1;SMC;15,1788;0,1832
1;SMC;16,2002;-0,0848
1;SMC;15,0008;0,2784
1;SMC;14,7586;0,2794
1;SMC;16,3034;-0,118
1;SMC;16,4006;-0,1251
1;SMC;15,849;-0,0155
1;SMC;16,3728;-0,0437
1;SMC;13,959;0,5954
1;SMC;15,9233;0,0135
1;SMC;15,1752;0,2438
1;SMC;14,8222;0,3179
1;SMC;16,0276;0,0558
1;SMC;15,2084;0,1235
1;SMC;16,3546;-0,1292
1;SMC;14,5508;0,4422
1;SMC;15,656;0,1128
1;SMC;15,2515;0,2473
1;SMC;15,8121;0,0231
1;SMC;15,6758;0,0838
1;SMC;16,729;-0,1389
1;SMC;16,2468;-0,126
1;SMC;13,9121;0,5834
1;SMC;14,368;0,4634
1;SMC;15,7206;0,0583
1;SMC;15,6693;0,0931
1;SMC;16,2687;-0,0599
1;SMC;15,0676;0,227
1;SMC;15,5143;0,1668
1;SMC;15,7076;0,0811
1;SMC;15,566;0,0386
1;SMC;16,1032;-0,0477
1;SMC;16,2852;-0,0936
1;SMC;13,9415;0,5344
1;SMC;13,7318;0,6038
1;SMC;14,6932;0,2731
1;SMC;17,5597;-0,4531
1;SMC;15,6816;0,0183
1;SMC;16,6984;-0,0744
1;SMC;15,0062;0,2869
1;SMC;15,8423;0,0837
1;SMC;15,6786;0,1166
1;SMC;14,6876;0,3651
1;SMC;15,5642;0,1374
1;SMC;16,8114;-0,1078
1;SMC;14,795;0,2782
1;SMC;14,2601;0,4012
1;SMC;16,4018;-0,1529
1;SMC;14,9727;0,2929
1;SMC;15,5267;0,1388
1;SMC;15,0455;0,2939
1;SMC;16,1594;-0,0279
1;SMC;15,6552;0,0574
1;SMC;14,4008;0,4278
1;SMC;16,1806;-0,0993
1;SMC;15,8383;0,0532
1;SMC;15,4704;0,1488
1;SMC;16,3872;-0,0714
1;SMC;14,7915;0,3349
1;SMC;13,9011;0,5528
1;SMC;16,5788;-0,1133
1;SMC;13,9728;0,5471
1;SMC;15,8312;0,048
1;SMC;15,696;0,0947
1;SMC;16,378;-0,0909
1;SMC;15,3721;0,1404
1;SMC;14,9808;0,2511
1;SMC;15,7881;0,0277
1;SMC;15,7657;0,0796
1;SMC;15,9406;0,0803
1;SMC;15,5712;0,1499
1;SMC;15,4664;0,1231
1;SMC;16,3175;-0,0522
1;SMC;15,4929;0,1124
1;SMC;13,5586;0,3835
1;SMC;16,205;-0,0705
1;SMC;15,55;0,08
1;SMC;17,5096;-0,2768
1;SMC;15,8832;0,0417
1;SMC;17,738;-0,542
1;SMC;14,5475;0,4257
1;SMC;15,4079;0,0751
1;SMC;16,2626;0,0103
1;SMC;14,5742;0,3754
1;SMC;16,521;-0,1554
1;SMC;16,791;-0,1832
1;SMC;15,4673;0,1727
1;SMC;14,2996;0,4629
1;SMC;13,6418;0,6525
1;SMC;15,7457;0,0729
1;SMC;15,4886;0,1447
1;SMC;14,7568;0,3357
1;SMC;15,482;0,1373
1;SMC;16,1634;-0,0447
1;SMC;15,7054;0,1234
1;SMC;14,5147;0,4154
1;SMC;15,0815;0,2683
1;SMC;15,992;-0,0153
1;SMC;14,3333;0,4373
1;SMC;15,3798;0,1507
1;SMC;15,957;-0,0025
1;SMC;15,889;0,0482
1;SMC;16,3458;-0,0707
1;SMC;15,565;0,17
1;SMC;15,0304;0,273
1;SMC;14,0869;0,4998
1;SMC;14,986;0,2767
1;SMC;16,144;-0,0551
1;SMC;15,5166;0,1347
1;SMC;14,3772;0,4966
1;SMC;15,8712;0,0196
1;SMC;14,6147;0,3938
1;SMC;16,7266;-0,1534
1;SMC;15,6266;0,1039
1;SMC;14,3126;0,4288
1;SMC;15,9238;-0,016
1;SMC;16,1556;-0,0916
1;SMC;14,6832;0,3555
1;SMC;14,9996;0,3125
1;SMC;14,8072;0,313
1;SMC;17,2238;-0,2249
1;SMC;14,2168;0,4893
1;SMC;16,0782;-0,0494
1;SMC;15,9124;0,0302
1;SMC;14,6897;0,3772
1;SMC;14,8998;0,317
1;SMC;14,3068;0,4708
1;SMC;14,9732;0,2529
1;SMC;16,1034;-0,0252
1;SMC;15,2416;0,2186
1;SMC;15,9578;-0,0056
1;SMC;14,605;0,3675
1;SMC;15,3892;0,1909
1;SMC;14,1306;0,5392
1;SMC;14,2198;0,4472
1;SMC;15,9806;0,1076
1;SMC;17,3222;-0,3888
1;SMC;14,8756;0,3077
1;SMC;16,4862;-0,1431
1;SMC;15,453;0,1643
1;SMC;15,719;0,105
1;SMC;15,0462;0,2544
1;SMC;14,3558;0,4541
1;SMC;13,7118;0,6472
1;SMC;14,9858;0,3054
1;SMC;14,7582;0,3293
1;SMC;15,8872;0,0343
1;SMC;14,2318;0,4783
1;SMC;15,7902;0,1023
1;SMC;15,7548;0,0084
1;SMC;16,3536;-0,1291
1;SMC;15,7356;0,0787
1;SMC;15,0988;0,2505
1;SMC;15,007;0,1926
1;SMC;15,0572;0,2629
1;SMC;15,4202;0,1177
1;SMC;14,5873;0,4062
1;SMC;14,274;0,472
1;SMC;15,953;0,032
1;SMC;15,1688;0,1666
1;SMC;15,4486;0,1694
1;SMC;16,2714;-0,084
1;SMC;14,1066;0,444
1;SMC;14,1883;0,4876
1;SMC;14,6876;0,3783
1;SMC;16,2804;-0,0307
1;SMC;16,004;0,0296
1;SMC;15,5427;0,0665
1;SMC;15,2691;0,1932
1;SMC;15,0723;0,2626
1;SMC;16,4086;-0,135
1;SMC;16,1279;-0,0629
1;SMC;14,6822;0,3247
1;SMC;16,1232;-0,1099
1;SMC;14,3967;0,4784
1;SMC;16,1678;-0,019
1;SMC;14,3868;0,4022
1;SMC;14,738;0,3264
1;SMC;15,8982;0,0036
1;SMC;16,0884;-0,0763
1;SMC;14,7889;0,3277
1;SMC;15,5037;0,1452
1;SMC;14,9974;0,3175
1;SMC;16,1114;-0,0793
1;SMC;15,5855;0,0736
1;SMC;15,1194;0,2507
1;SMC;15,1229;0,2498
1;SMC;15,5506;0,0998
1;SMC;15,8262;0,0085
1;SMC;17,6762;-0,4719
1;SMC;15,512;0,1091
1;SMC;15,1242;0,2304
1;SMC;14,8618;0,2606
1;SMC;15,8314;-0,0355
1;SMC;13,9661;0,5273
1;SMC;15,7528;0,0473
1;SMC;15,4834;0,1461
1;SMC;16,1654;0,0084
1;SMC;17,02;-0,0819
1;SMC;15,7764;0,0479
1;SMC;15,1877;0,2523
1;SMC;15,2879;0,1914
1;SMC;16,2964;-0,0454
1;SMC;15,5908;0,1223
1;SMC;15,6662;0,0394
1;SMC;15,5124;0,1418
1;SMC;14,876;0,2962
1;SMC;16,015;-0,0057
1;SMC;14,6491;0,4071
1;SMC;16,5376;-0,1862
1;SMC;16,4474;-0,1131
1;SMC;16,0558;0,0361
1;SMC;16,6338;-0,2435
1;SMC;18,2798;-0,5471
1;SMC;15,7256;0,0648
1;SMC;16,963;-0,2991
1;SMC;15,5069;0,1115
1;SMC;15,0298;0,1803
1;SMC;16,3346;-0,1174
1;SMC;14,794;0,3238
1;SMC;14,271;0,4877
1;SMC;15,9154;0,0438
1;SMC;16,5047;-0,1339
1;SMC;16,65;-0,1978
1;SMC;14,8017;0,3421
1;SMC;15,397;0,1778
1;SMC;16,8134;-0,2104
1;SMC;14,3519;0,421
1;SMC;14,6731;0,3168
1;SMC;15,2232;0,2349
1;SMC;14,6852;0,3608
1;SMC;14,9719;0,1979
1;SMC;15,1469;0,2306
1;SMC;15,2132;0,1439
1;SMC;14,788;0,3559
1;SMC;15,638;0,131
1;SMC;15,1227;0,1846
1;SMC;15,7846;-0,0333
1;SMC;16,1864;-0,0533
1;SMC;16,4067;-0,0201
1;SMC;16,7493;-0,236
1;SMC;16,5681;-0,2147
1;SMC;15,6974;0,0783
1;SMC;16,1395;-0,074
1;SMC;14,7655;0,3273
1;SMC;14,5638;0,3947
1;SMC;16,6594;-0,1952
1;SMC;16,1283;-0,0393
1;SMC;15,9034;0,0257
1;SMC;15,8515;0,0495
1;SMC;15,0717;0,3022
1;SMC;15,3598;0,1681
1;SMC;14,4274;0,4869
1;SMC;16,2396;-0,0553
1;SMC;16,082;-0,0294
1;SMC;14,8533;0,2512
1;SMC;14,6503;0,3586
1;SMC;16,1;-0,0353
1;SMC;15,6848;0,1708
1;SMC;15,9834;0,0201
1;SMC;14,3646;0,4274
1;SMC;15,285;0,1942
1;SMC;15,1247;0,2598
1;SMC;15,7448;0,0919
1;SMC;15,6758;0,1366
1;SMC;15,0902;0,226
1;SMC;14,0126;0,5439
1;SMC;15,9319;-0,082
1;SMC;15,0558;0,2398
1;SMC;14,5532;0,4375
1;SMC;14,8176;0,3557
1;SMC;15,1869;0,2378
1;SMC;14,5042;0,3989
1;SMC;14,7118;0,2721
1;SMC;14,5803;0,3939
1;SMC;15,4836;0,1186
1;SMC;15,2548;0,2071
1;SMC;15,5388;0,1499
1;SMC;15,507;0,1285
1;SMC;13,958;0,5414
1;SMC;16,4458;-0,0405
1;SMC;15,6919;0,0892
1;SMC;14,4196;0,4557
1;SMC;15,7577;0,03
1;SMC;16,382;-0,1317
1;SMC;14,456;0,4701
1;SMC;15,5165;0,0565
1;SMC;16,198;-0,0138
1;SMC;16,1511;-0,0355
1;SMC;14,3661;0,4568
1;SMC;15,088;0,2109
1;SMC;14,3802;0,4206
1;SMC;14,7786;0,2707
1;SMC;15,2855;0,3013
1;SMC;15,3114;0,1119
1;SMC;15,43;0,1134
1;SMC;16,1082;-0,0503
1;SMC;16,2348;-0,022
1;SMC;15,9953;-0,0417
1;SMC;15,2678;0,1952
1;SMC;15,1298;0,2325
1;SMC;15,1712;0,2456
1;SMC;15,5435;0,1342
1;SMC;15,8772;0,0307
A simple solution:
arrays=df.groupby(['Mode','Cloud']).apply(lambda grp : residual_function(grp))
residuals_value=[]
[residuals_value.extend(elem.tolist()) for elem in arrays]
df["residuals"]=residuals_value

Smart Algorithm to identify numbers with wrong sign

I have a list of 1070 numbers (account balances) extracted from a source system, but due to technical issues, some of these values have the wrong sign (so I get for example 100 instead of -100)
I only have one information, once all the values have the correct sign, I will sum up to zero (but of course I have no idea how many figures have a wrong sign).
I tried to brute force a solution with the algorithm below, but it already takes forever when I am just combining 3 numbers (so reversing the sign of 3 numbers out of the 1070).
I believe that even if I optimize the my code, the number of combinations if I for example reverse 565 out of the 1070 elements is so large (5,740547E+319) that any brute force attemps will fail
I am basically trying trying to reverse one value in the list and then check if the sum is 0, then 2 values, 3 values and so on
It of course runs fine with only 6 numbers like below.
Does anybody has a suggestion of to approach that in a smarter way ?
import itertools
import numpy as np
test_list = np.array([1,2,3,4,5,9])
index_list = np.arange(0, len(test_list), dtype=np.intp)
sum_list = test_list.sum()
for L in range(1, len(test_list)+1):
print('current list lenght: ' + str(L))
for subset in itertools.combinations(index_list, L):
cur_list = np.array(test_list)
check = sum_list - (2 * cur_list[[subset]].sum())
if check == 0:
print('found:', subset)
This simple example has multiple solutions, the real values are more unique (and positive as well as negative), so I would not worry too much about having multiple solutions.
My list is the following (removed zero values):
[511720.02, 39409.62, 14680.43, 731.29, 10387.38, 2256.56, 262681.13, 5897.66, 11060.76, 144271.31, 25914.87, 13015.5, 19316.85, 40208606.69, -5846350.44, -33538929.18, -540682.74, 68089.94, 561696.88, 58050.78, 469706.4, 524.67, 472701.44, 2158456.56, 1158292.03, 100024.37, 18134.69, 337825.89, 10180.76, 2228315.58, 772.53, 8549.91, 43307.27, 39642.75, 72176.45, 323822.22, 962998.36, 135.5, 134388.73, 1473523.1, 275221.49, 34267.25, 549705.04, 247.87, 12958.72, 847714.28, 1781791.26, 3010.0, 1895276.98, 14434.11, 104587.1, 38056.23, 24962.62, 92497.96, 1227702.25, 110346.36, 391.85, 208.41, 8756.85, 782736.47, 3147519.19, 194767.75, 295568.31, 100694.2, 1893.93, 1133698.81, 523.2, 280280.91, 3078.82, 289841.77, 515.2, 175112.67, 24084.99, 35048.85, 49398.15, 41109.64, 1023.53, 782319.87, 28.14, 20.75, 13227.61, 14765.65, 41182.6, 4297.29, 1340.99, 826014.08, 6111.16, 965389.36, 673482.76, 109298.96, 39807.35, 311.79, 437149.28, 1950968.88, 325.21, 2764917.36, 8838.14, 202885.02, 25.49, 999.66, 743027.37, 759.22, 2950.0, 96146.21, 165.2, 21956.69, 1811289.92, 58.0, 6982282.03, 169464.71, 537268.28, 32655.3, 2474912.35, 1066214.61, 87962.0, 81526.67, 49053309.4, 45032405.02, 49548828.59, 48930853.47, 3533339.79, 3343489.4, 61758.14, 52772.61, 1095708.2, 819624.62, 141.17, 8611.75, 88752.23, 14669477.14, 22308370.28, 1215208.59, -183222.0, 99579.07, 621585.75, -26967.75, -787397.0, 18509117.59, 1212170.47, 60214.78, -749.37, 77455.94, 787350.1, 32760.21, 8117.1, 18493.03, 8267483.6, -15627.16, 58625.11, 38622.21, 57.11, 47565.71, 3523.6, 3205.0, 113242.59, 73.76, 782949.24, 5368.09, -4300.0, 2160047.12, -3533.08, 2460435.1, 50990.31, 93463.6, 1487.07, 22470.0, 22470.0, 999344.79, 135237.18, 9281.62, 3430281.72, 7126642.53, -53338.0, 9412.32, 3344946.88, 83075155.43, 17856133.2, 13449.34, 3845.0, 689998.56, 337645.3, 5937356.47, -2491.16, 2199069.77, 167652.42, 3331515.65, 1124710.59, 34075.85, 494639.09, 385540.84, 5891.39, 14378783.44, 7111253.62, 1247695.94, 1.0, 1.0, 138841.22, 0.5, 5979482.63, 1263134.4, 1.0, 5700.4, 12000000.0, 6100000.0, 1850000.0, 1000000.0, 500000.0, 51000.0, 77081.0, 19288853.74, 11600000.0, 4094000.0, 100000.0, 32400.0, 80000.0, 100000.0, 40810000.0, 33500000.0, 2336976.0, 812290.0, 177655.1, 1187432.01, 5224021.89, 4733986.5, 6174765.0, 1646604.82, 535146.3, 695690.19, 2858833.86, 863125.08, 859612.55, 631772.99, 100000.0, -200000.0, -177654.1, 10950.0, 25040.2, 1659670.0, 1143444.46, 3861357.87, 505930.63, 573072.0, 105000.0, 57500.0, -505929.63, -57499.0, 3402777.8, 54270.0, 105000.0, 44717.27, 1725619.5, 928972.0, 382924.78, 110015.09, 500.0, 100000.0, -1779887.33, -105000.0, -44717.27, -1311895.78, 19257544.9, 786109.73, 3885330.13, 9200000.0, 4347805.0, 464486.0, 13300000.0, 500000.0, 900000.0, 4000000.0, 550000.0, 46633144.87, 3657123.02, 2400000.0, 775000.0, 600000.0, 4980000.0, 715092.4, 250000.0, -715092.4, 5407573.99, 6516939.56, 71570143.67, -59186479.4, 1058557.22, -772031.22, 210000.0, 1753591.07, -1630557.07, 37550879.01, 2346460.63, -25169822.77, -1890843.63, 727919.84, -528559.84, 1073986.29, -556999.29, 5547811.48, -3130409.48, 8207549.38, 81942.17, 4489158.99, -7039209.16, -81942.17, -2143400.99, 89544215.17, -37091376.17, 1572011.0, -355928.0, 7478446.23, -595640.23, 32986206.95, -6325980.34, 13565577.0, -2178294.0, 32642339.14, -1005400.0, 3047129.66, 4586021.0, 67050.27, 60878226.61, -2654606.01, -2904000.0, 8393687.95, -18019508.06, -24442013.89, 1215208.59, 177570.85, -18047334.03, -1345725.77, 60214.78, -18212.52, -1823768.35, -354430.28, -8385048.47, 74505.96, -113659.2, 663309.32, -7694.18, -14335.0, 2160047.12, 4953.83, -228189.6, -100945.64, -8846.8, -2000000.0, -1102232.0, 205.2, 700000.0, 1550000.0, 500000.0, -29170503.05, -9741127.06, 2489697.93, -13599529.61, -8942775.78, -32726828.34, -14763682.06, -627846.99, -2340642.03, -4760527.23, -23148108.83, -33891335.24, -24840602.25, -39314900.39, -22877589.68, -2846969.98, -581650.3, -1269764.39, -665159.0, -2846969.98, -418.13, -4545969.04, -2281584.61, -15697827.3, -14778873.52, -18421816.45, -6420171.98, -781896.2, -1038820.41, -80650.97, -142900.19, -614263.27, -15871.81, -3386450.0, 3301075.71, -4058.89, -10407668.35, -8988470.62, -2236.0, -60178.92, -6202.25, -200000.0, -91700.3, -303039.14, -18543.12, -25149.83, -51468.44, -10100.0, -11755.05, -254974.16, -121982.45, -434.1, -853763.93, -100.08, 233961.15, 3521.99, -3776.15, -46650.33, -11412.02, -7970.43, -9798.65, -3942496.09, -1196495.36, -246462.91, -178049.1, -0.01, -18351592.93, -6551763.1, -5598.84, -264535.23, -425063.65, -48942.22, -6434834.64, -684003.27, -7617.96, -543416.91, -596612.84, -2896846.65, -203847.0, 5389.94, -37406548.94, -2609.35, -3543154.17, -83500.0, -1685476.4, -261289.34, -3342018.62, -4850000.0, 1500000.0, 4125000.0, -0.04, -89352.19, -178114.13, -54520.6, -15193100.0, -30960000.0, -3900000.0, -1000000.0, -10000000.0, -8361980.61, -8516941.31, -25000000.0, -5000000.0, -5000000.0, -8170843.24, -472127.77, -25000000.0, -1615441.58, -5697557.72, -18000.0, -810000.0, -362623.0, -526089.98, -8300000.0, -220000.0, 7.62, 15542.39, -25800625.31, -33795061.06, -20780610.38, -4665030.75, -39482892.35, -6840474.74, -18446631.31, -10152810.85, 2216320.89, -83747.0, -403572.0, 21763733.0, -3865209.08, -42267747.62, -263520555.75, 195087.06, -542668069.06, -54499963.22, -46824.57, -80703953.44, -34388289.6, -1120605.64, -1029611.15, -542066.51, -154157.05, -7932466.7, -13257498.78, -11093844.91, -2844716.35, -1361609.65, -5349483.43, -1439399.68, -2694.5, -1181.62, -418050.47, -400674.41, -246043195.73, -44799841.1, -326603330.98, -63937178.0, -37506337.11, -15076181.32, -488966.6, -230800995.11, -10509.4, -7575.0, -106584.18, -36375883.12, -45115231.08, -4305941.08, -9238.75, -516324.15, -10065.15, -2316745.72, -643656.45, -53267.0, -298191.95, -3537748.57, -399554.25, -13437.34, -2112.0, -93177.32, -306454.74, 24222.0, -12000.0, 14364.81, 19851.3, 39903.56, 12000.0, 175747.84, -353732.71, 926.66, -1311895.78, 1365487.35, 623561637.34, 1103900.52, 74.0, 36243106.75, 400408.55, 31379746.27, 1152340.15, 277020.97, 351518.86, 24432.73, 370113.15, 57822.7, 14334602.55, 5085111.06, 141482.62, 2960.2, 17357.8, 933574.99, 116678.06, 7191271.0, 1686605.85, 867515.1, -113006.87, 29156.65, 143305.39, 38947.38, 2992693.68, -504.46, -40954.64, 114478.4, 194370206.88, 24548647.12, 745995.52, 603106175.89, 15577814.31, 38526313.97, 43750465.62, 3.1, 35806829.4, 26656590.6, 1957311.8, 8649.7, 7575.15, 5230.3, 10083.33, 1076.43, 1047611.42, 172125.45, 3686.0, 134997.45, 8605.48, 677961.04, 82822.75, 133569.18, 1961196.0, 91776.21, 245448.12, 821.0, 1341.74, 137930.46, -8990.0, -26766176.74, 424769.32, 142428.86, -18789.13, 268399.38, 50263.7, -85550.06, 125538.91, 6263.29, 19500.75, 245829.52, -1365487.35, 40307915.86, 295222.37, -96036.81, 3166665.78, 1932755.66, 40400.0, -525840.25, 266808.43, 199000.0, -3737.2, 492669.16, -1969978.35, 1708500.83, 2748188.97, 643513.78, 2964400.04, 642333.18, 341338.4, 15289.73, 380235.94, 310.13, 108315.14, 638.16, 11507.44, 48799.64, -382413.8, 406563.18, 11080.63, 129207.66, 32419.8, 465.23, 53502.74, 263531.85, 370042.5, 123341.62, -9786.44, -124800.25, 71673.89, 3318959.25, 597466.94, 182928.82, 28019.14, 319467.85, 1563.75, 1660609.86, -1651940.0, 2806793.29, 84600.0, 27733.67, 714.71, 31198.43, 224970.45, 10020.87, 68734.49, 103156.32, 246821.22, 19097.3, 256539.34, 144102.4, 12122.3, 2604333.41, 191148.48, 94008.23, 6807.85, 2723.89, 5438.84, 122772.35, 156237.16, 24024.39, 705426.92, 187992.86, 132421.04, 241566.49, 102682.38, 41216.24, 4088.52, 1070878.31, 409464.57, 170804.67, 187236.66, 1298978.37, 42352.12, 1483572.01, 2083796.08, 9745.32, 15594.62, 58735.3, 83374.68, 20845.17, 739655.98, 45957.1, 24405.0, 111086.39, 150567.3, 23445.92, 2990.48, 8795.7, 26405.51, 459362.72, 51837.97, 144697.12, 4458.01, 300.0, 29541.52, 1954234.69, 66521.56, 40637.54, 29210.19, 11358.95, 38928.39, 95187.44, 113840.33, 66843.61, 34180.65, 19445.79, 52893.81, 138057.3, 205782.91, 98563.65, 111475.3, 197494.77, 6158.15, 1601.86, 116963.83, -1182305.05, 233113.73, -401948.82, 129.03, 497791.24, 6686.47, 131146.21, 26251.23, 368095.15, 25589.06, 39885.15, 882466.81, 193038.84, 293224.67, 123307.79, -35000.0, 3231.0, -5653952.45, 5469195.26, 243.15, 32610.33, 11495.93, 689585.9, 745.95, 221338.04, 83678.41, 52225.97, 14265.34, 4517.46, 2348.95, 98884.76, 1929.14, 8676.78, 126999.52, 48450.0, 23018.67, 642.63, 11311.66, 86076.58, 59632.21, 1200.0, 244068.03, 738908.91, 1111.06, 53129.02, 18323.65, 254206.26, 16409.53, 22472.94, 49361.21, 796671.0, 2618127.73, 158343.65, 5502.42, -21168.21, -33261.68, -3124673.81, -52827.56, -75.82, -71499.0, -185842.54, 776135.12, -56041.39, -151492.94, 146416.64, -363807.65, -1041536159.36, 1042111293.86, -343423458.56, 343105397.4, -8215190.59, 8189738.0, 10790777.98, 88377.0, 3968265.59, 1089147.0, 177964.0, 203973.0, 249376.0, 1107136.21, -1302612.04, -20665748.07, -268427.98, -1032648.0, -255228.63, -627322.81, -2680023.09, -2759982.21, -1260600.0, 121498.6, 64347.8, 76153.8, -146127.65, -317598.55, -147069.85, 245057.06, -245058.0, -85600.0, -728220.16, -121788.4, 41998.97, -236262.33, 330582.33, 225235.91, -86822.99, 3280734.73, 1734714.87, 14327.0, 6795.0, 49137.0, 334939.46, -375322.2, 2108892.54, 205427.44]
I can think of many ways I might try to solve this problem, but the bottom line is you'll never know what side of the equation is supposed to be negative.
+9-6-3 = 0
But this also applies to
-9+6+3 = 0
In other words: Even if you manage to sort out both sides of the equation, you'll always be left with two equally possible outcomes.

Matplotlib and cartopy contours coming out completely wrong

I'm trying to plot latency maps of the world (for the moment, from London).
I have a database with a series of latencies between GPS points. I'd like to plot these on a map of the world with contour lines at various levels of latency, eg 50ms, 100ms, 200ms+ etc.
Right now I'm working with some sample code from the cartopy project for drawing labelled contours.
#!/usr/bin/env python3
from collections import defaultdict
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
import numpy as np
from cartopy.examples.waves import sample_data
def main():
# lat, long and then latency from london
zs = [
(55.30927, 25.07725, 123.822),
(19.81889, 41.3275, 61.154),
(-58.37723, -34.61315, 250.024),
(16.37208, 48.20849, 26.987),
(15.45, 47.06667, 49.47),
(115.8614, -31.95224, 273.459),
(138.59863, -34.92866, 257.056),
(151.20732, -33.86785, 258.382),
(144.96332, -37.814, 259.542),
(149.12807, -35.28346, 291.766),
(153.02809, -27.46794, 283.675),
(49.89201, 40.37767, 89.569),
(90.40744, 23.7104, 232.381),
(5.56749, 50.63373, 11.093),
(4.34878, 50.85045, 9.644),
(3.22424, 51.20892, 10.713),
(4.40026, 51.22047, 10.905),
(27.91667, 43.21667, 47.367),
(23.32415, 42.69751, 52.414),
(-34.86306, -7.115, 208.491),
(-46.63611, -23.5475, 180.227),
(-47.92972, -15.77972, 227.893),
(-113.46871, 53.55014, 138.725),
(-73.58781, 45.50884, 84.456),
(-75.69812, 45.41117, 83.592),
(-106.66892, 52.13238, 108.197),
(-79.4163, 43.70011, 90.885),
(-123.11934, 49.24966, 130.308),
(-97.14704, 49.8844, 159.187),
(-63.57291, 44.6464, 74.226),
(-71.21454, 46.81228, 85.994),
(8.55, 47.36667, 22.503),
(8.96004, 46.01008, 33.557),
(6.63282, 46.516, 27.375),
(7.44744, 46.94809, 18.838),
(7.57327, 47.55839, 27.376),
(-70.64827, -33.45694, 195.647),
(114.0683, 22.54554, 233.257),
(121.45806, 31.22222, 191.371),
(120.16142, 30.29365, 237.881),
(114.87944, 40.81, 206.936),
(-75.56359, 6.25184, 150.812),
(-74.08175, 4.60971, 153.555),
(-84.11651, 10.00236, 140.832),
(33.03794, 34.68406, 64.037),
(14.42076, 50.08804, 27.247),
(16.60796, 49.19522, 29.384),
(11.07752, 49.45421, 17.739),
(11.57549, 48.13743, 20.171),
(9.99302, 53.55073, 43.907),
(8.68417, 50.11552, 13.733),
(6.77616, 51.22172, 12.371),
(12.10466, 47.7044, 19.85),
(12.56553, 55.67594, 16.867),
(3.08746, 36.73225, 40.629),
(-78.52495, -0.22985, 161.671),
(24.75353, 59.43696, 34.33),
(31.24967, 30.06263, 63.373),
(-0.37739, 39.46975, 32.652),
(-3.70256, 40.4165, 23.838),
(2.15899, 41.38879, 29.685),
(24.93545, 60.16952, 33.84),
(7.74553, 48.58392, 13.785),
(3.17456, 50.69421, 4.4),
(2.3488, 48.85341, 8.154),
(4.84671, 45.74846, 21.794),
(-1.61396, 54.97328, 5.601),
(-2.23743, 53.48095, 7.15),
(0.51667, 51.26667, 1.404),
(-1.12902, 50.79509, 3.552),
(-3.19648, 55.95206, 10.398),
(-1.51217, 52.40656, 6.462),
(-2.07972, 51.90006, 4.167),
(-3.18, 51.48, 6.116),
(-2.59665, 51.45523, 4.497),
(-5.92541, 54.59682, 10.33),
(44.83368, 41.69411, 88.784),
(-0.1969, 5.55602, 97.088),
(23.72784, 37.98376, 56.074),
(22.93086, 40.64361, 61.766),
(-90.51327, 14.64072, 342.363),
(114.17469, 22.27832, 219.061),
(15.97798, 45.81444, 31.988),
(19.04045, 47.49835, 28.312),
(106.84513, -6.21462, 191.802),
(-6.24889, 53.33306, 11.926),
(-6.92611, 52.84083, 12.585),
(35.21633, 31.76904, 63.795),
(34.78057, 32.08088, 111.049),
(-4.48333, 54.15, 14.732),
(78.15538, 11.65376, 70.362),
(73.85535, 18.51957, 274.087),
(77.22445, 28.63576, 150.969),
(80.27847, 13.08784, 144.037),
(75.8333, 22.71792, 137.159),
(78.45636, 17.38405, 187.213),
(72.88261, 19.07283, 187.64),
(77.59369, 12.97194, 131.413),
(-21.89541, 64.13548, 38.428),
(13.33561, 38.13205, 52.313),
(12.33265, 45.43713, 38.471),
(12.51133, 41.89193, 31.075),
(9.18951, 45.46427, 30.8),
(13.34109, 41.63976, 41.74),
(11.88068, 43.46276, 34.63),
(139.69171, 35.6895, 215.214),
(135.50218, 34.69374, 233.671),
(141.35, 43.06667, 242.554),
(36.81667, -1.28333, 174.557),
(104.91601, 11.56245, 208.175),
(126.9784, 37.566, 266.233),
(73.10211, 49.80187, 123.06),
(35.50157, 33.89332, 64.207),
(25.2798, 54.68916, 38.825),
(23.31667, 55.93333, 42.406),
(6.13, 49.61167, 15.731),
(24.10589, 56.946, 38.292),
(-5.00028, 34.03313, 77.605),
(28.8575, 47.00556, 51.354),
(14.5148, 35.89968, 48.426),
(-103.39182, 20.66682, 132.319),
(3.39467, 6.45407, 96.877),
(4.29861, 52.07667, 8.78),
(4.47917, 51.9225, 6.952),
(6.56667, 53.21917, 8.917),
(5.47778, 51.44083, 8.77),
(5.71806, 52.525, 7.052),
(4.88969, 52.37403, 6.88),
(4.66111, 51.86583, 9.274),
(10.74609, 59.91273, 28.073),
(5.32415, 60.39299, 28.998),
(174.77557, -41.28664, 282.141),
(172.63333, -43.53333, 273.846),
(174.76349, -36.84853, 279.023),
(-79.51973, 8.9936, 150.216),
(-77.02824, -12.04318, 163.241),
(120.9822, 14.6042, 220.693),
(120.33325, 16.04313, 245.787),
(74.35071, 31.558, 150.221),
(21.01178, 52.22977, 31.504),
(18.64912, 54.35227, 38.029),
(-66.10572, 18.46633, 106.983),
(-9.13333, 38.71667, 50.867),
(26.10626, 44.43225, 47.648),
(21.90333, 43.32472, 48.541),
(20.46513, 44.80401, 38.377),
(30.31413, 59.93863, 36.871),
(37.61556, 55.75222, 49.041),
(49.12214, 55.78874, 58.591),
(82.9346, 55.0415, 127.4),
(131.87353, 43.10562, 147.576),
(46.72185, 24.68773, 88.155),
(18.06871, 59.32938, 26.838),
(11.96679, 57.70716, 56.335),
(103.85007, 1.28967, 251.641),
(14.50513, 46.05108, 36.656),
(17.10674, 48.14816, 27.031),
(-55.16682, 5.86638, 166.626),
(100.50144, 13.75398, 265.619),
(10.16579, 36.81897, 52.035),
(27.13838, 38.41273, 67.678),
(32.85427, 39.91987, 60.337),
(28.94966, 41.01384, 51.519),
(29.06013, 40.19559, 72.622),
(121.53185, 25.04776, 261.82),
(39.26951, -6.82349, 150.264),
(30.5238, 50.45466, 41.29),
(36.25272, 49.98081, 58.363),
(32.58219, 0.31628, 159.655),
(-77.03637, 38.89511, 78.045),
(-81.65565, 30.33218, 94.374),
(-80.19366, 25.77427, 99.16),
(-81.37924, 28.53834, 97.119),
(-82.45843, 27.94752, 101.628),
(-84.38798, 33.749, 87.471),
(-81.09983, 32.08354, 119.433),
(-86.15804, 39.76838, 91.394),
(-90.07507, 29.95465, 116.938),
(-76.61219, 39.29038, 77.512),
(-94.57857, 39.09973, 98.802),
(-90.19789, 38.62727, 90.391),
(-90.18481, 32.29876, 105.299),
(-82.55402, 35.60095, 87.855),
(-80.84313, 35.22709, 92.297),
(-78.63861, 35.7721, 83.355),
(-84.51439, 39.12711, 96.657),
(-82.99879, 39.96118, 85.065),
(-97.51643, 35.46756, 108.011),
(-75.16379, 39.95233, 70.659),
(-83.92074, 35.96064, 111.042),
(-90.04898, 35.14953, 106.578),
(-97.74306, 30.26715, 117.634),
(-96.80667, 32.78306, 113.133),
(-95.36327, 29.76328, 105.161),
(-98.49363, 29.42412, 117.229),
(-93.60911, 41.60054, 101.56),
(-87.65005, 41.85003, 89.144),
(-88.30535, 41.88753, 26.006),
(-86.25001, 41.68338, 89.071),
(-71.05977, 42.35843, 75.733),
(-83.04575, 42.33143, 92.257),
(-84.55553, 42.73253, 97.811),
(-93.26384, 44.97997, 97.597),
(-96.66696, 40.8, 97.95),
(-74.39904, 40.49927, 69.437),
(-74.05653, 40.78955, 71.265),
(-73.75623, 42.65258, 74.285),
(-78.87837, 42.88645, 79.13),
(-73.96625, 40.78343, 68.356),
(-74.00597, 40.71427, 71.41),
(-76.14742, 43.04812, 76.038),
(-81.8418, 41.23811, 83.061),
(-81.69541, 41.4995, 93.716),
(-83.55521, 41.66394, 97.349),
(-79.99589, 40.44062, 87.723),
(-75.6649, 41.40916, 73.833),
(-88.01983, 44.51916, 102.133),
(-112.07404, 33.44838, 130.966),
(-121.98857, 37.54827, 134.523),
(-118.24368, 34.05223, 136.396),
(-121.4944, 38.58157, 136.928),
(-117.16472, 32.71571, 146.006),
(-122.41942, 37.77493, 141.373),
(-121.89496, 37.33939, 133.461),
(-104.82136, 38.83388, 108.739),
(-104.9847, 39.73915, 121.039),
(-106.65114, 35.08449, 164.648),
(-115.13722, 36.17497, 146.236),
(-122.39168, 40.58654, 156.6),
(-122.67621, 45.52345, 130.65),
(-123.34174, 43.2165, 147.008),
(-111.89105, 40.76078, 151.18),
(-122.33207, 47.60621, 129.576),
(-157.85833, 21.30694, 186.991),
(-56.18816, -34.90328, 228.291),
(-66.87919, 10.48801, 148.292),
(106.62965, 10.82302, 305.353),
(105.84117, 21.0245, 240.46),
(21.16688, 42.67272, 48.995),
(28.04363, -26.20227, 165.392),
(18.42322, -33.92584, 143.62),
]
z = np.array(zs, dtype="float")
breakpoint()
fig = plt.figure()
# Setup a global EckertIII map with faint coastlines.
ax = fig.add_subplot(1, 1, 1, projection=ccrs.EckertIII())
ax.set_global()
ax.coastlines("110m", alpha=0.1)
# Add colourful filled contours.
filled_c = ax.contourf(z, transform=ccrs.PlateCarree())
# And black line contours.
line_c = ax.contour(
z, levels=filled_c.levels, colors=["black"], transform=ccrs.PlateCarree()
)
# Uncomment to make the line contours invisible.
# plt.setp(line_c.collections, visible=False)
# Add a colorbar for the filled contour.
fig.colorbar(filled_c, orientation="horizontal")
# Use the line contours to place contour labels.
ax.clabel(
line_c, # Typically best results when labelling line contours.
colors=["black"],
manual=False, # Automatic placement vs manual placement.
inline=True, # Cut the line where the label will be placed.
fmt=" {:.0f} ".format, # Labes as integers, with some extra space.
)
plt.show()
if __name__ == "__main__":
main()
Instead of getting nice contours, I get this image:
What's my problem?
Am I passing the wrong args to the matplotlib functions?
Is numpy somehow interpreting my floats wrong?
You need to separate data into lat, long, and height. Then use tricontour type functions to generate the plot. Here is the relevant part of the modified code that handles the data and generate the plot.
# more code before this (see the question)
zs = np.array(zs)
# get `lat`, `long`, and `height` separately
lats, lons, zzz = zs[:,0], zs[:,1], zs[:,2]
fig = plt.figure()
# Setup a global EckertIII map with faint coastlines.
ax = fig.add_subplot(1, 1, 1, projection=ccrs.EckertIII())
ax.set_global()
ax.coastlines("110m", alpha=0.1)
# Add colourful filled contours.
filled_c = ax.tricontourf(lats, lons, zzz, transform=ccrs.PlateCarree())
# And black line contours.
line_c = ax.tricontour(
lats, lons, zzz, levels=filled_c.levels, colors=["black"], transform=ccrs.PlateCarree()
)
# Uncomment to make the line contours invisible.
# plt.setp(line_c.collections, visible=False)
# Add a colorbar for the filled contour.
fig.colorbar(filled_c, orientation="horizontal")
# Use the line contours to place contour labels.
ax.clabel(
line_c, # Typically best results when labelling line contours.
colors=["black"],
manual=False, # Automatic placement vs manual placement.
inline=True, # Cut the line where the label will be placed.
fmt=" {:.0f} ".format, # Labes as integers, with some extra space.
)
plt.show()

R DTW multivariate series with asymmetric step fails to compute alignment

I'm using the DTW implementation found in R along with the python bindings in order to verify the effects of changing different parameters(like local constraint, local distance function and others) for my data. The data represents feature vectors that an audio processing frontend outputs(MFCC). Because of this I am dealing with multivariate time series, each feature vector has a size of 8. The problem I'm facing is when I try to use certain local constraints ( or step patterns ) I get the following error:
Error in if (is.na(gcm$distance)) { : argument is of length zero
Traceback (most recent call last):
File "r_dtw_simplified.py", line 32, in <module>
alignment = R.dtw(canDist, rNull, "Euclidean", stepPattern, "none", True, Fa
lse, True, False )
File "D:\Python27\lib\site-packages\rpy2\robjects\functions.py", line 86, in _
_call__
return super(SignatureTranslatedFunction, self).__call__(*args, **kwargs)
File "D:\Python27\lib\site-packages\rpy2\robjects\functions.py", line 35, in _
_call__
res = super(Function, self).__call__(*new_args, **new_kwargs)
rpy2.rinterface.RRuntimeError: Error in if (is.na(gcm$distance)) { : argument is
of length zero
Because the process of generating and adapting the input data is complicated I only made a simplified script to ilustrate the error i'm receiving.
#data works
#reference = [[-0.126678, -1.541763, 0.29985, 1.719757, 0.755798, -3.594681, -1.492798, 3.493042], [-0.110596, -1.638184, 0.128174, 1.638947, 0.721085, -3.247696, -0.920013, 3.763977], [-0.022415, -1.643539, -0.130692, 1.441742, 1.022064, -2.882172, -0.952225, 3.662842], [0.071259, -2.030411, -0.531891, 0.835114, 1.320419, -2.432281, -0.469116, 3.871094], [0.070526, -2.056702, -0.688293, 0.530396, 1.962128, -1.681915, -0.368973, 4.542419], [0.047745, -2.005127, -0.798203, 0.616028, 2.146988, -1.895874, 0.371597, 4.090881], [0.013962, -2.162796, -1.008545, 0.363495, 2.062866, -0.856613, 0.543884, 4.043335], [0.066757, -2.152969, -1.087097, 0.257263, 2.592697, -0.422424, -0.280533, 3.327576], [0.123123, -2.061035, -1.012863, 0.389282, 2.50206, 0.078186, -0.887711, 2.828247], [0.157455, -2.060425, -0.790344, 0.210419, 2.542114, 0.016983, -0.959274, 1.916504], [0.029648, -2.128204, -1.047318, 0.116547, 2.44899, 0.166534, -0.677551, 2.49231], [0.158554, -1.821365, -1.045044, 0.374207, 2.426712, 0.406952, -1.055084, 2.543762], [0.077026, -1.863235, -1.14827, 0.277069, 2.669067, 0.362549, -1.294342, 1.66748], [0.101822, -1.800293, -1.126801, 0.364594, 2.503815, 0.294846, -0.881302, 1.281616], [0.166138, -1.627762, -0.866013, 0.494476, 2.450668, 0.569, -1.392868, 0.651184], [0.225006, -1.596069, -1.07634, 0.550049, 2.167435, 0.554123, -1.432983, 1.166931], [0.114777, -1.462769, -0.793167, 0.565704, 2.183792, 0.345978, -1.410919, 0.708679], [0.144028, -1.444458, -0.831985, 0.536652, 2.222366, 0.330368, -0.715149, 0.517212], [0.147888, -1.450577, -0.809372, 0.479584, 2.271378, 0.250763, -0.540359, -0.036072], [0.090714, -1.485474, -0.888153, 0.268768, 2.001221, 0.412537, -0.698868, 0.17157], [0.11972, -1.382767, -0.890457, 0.218414, 1.666519, 0.659592, -0.069641, 0.914307], [0.189774, -1.18428, -0.785797, 0.106659, 1.429977, 0.195236, 0.627029, 0.503296], [0.194702, -1.098068, -0.956818, 0.020386, 1.369247, 0.10437, 0.641724, 0.410767], [0.215134, -1.069092, -1.11644, 0.283234, 1.313507, 0.110962, 0.600861, 0.752869], [0.216766, -1.065338, -1.047974, 0.080231, 1.500702, -0.113388, 0.712646, 0.914307], [0.259933, -0.964386, -0.981369, 0.092224, 1.480667, -0.00238, 0.896255, 0.665344], [0.265991, -0.935257, -0.93779, 0.214966, 1.235275, 0.104782, 1.33754, 0.599487], [0.266098, -0.62619, -0.905792, 0.131409, 0.402908, 0.103363, 1.352814, 1.554688], [0.273468, -0.354691, -0.709579, 0.228027, 0.315125, -0.15564, 0.942123, 1.024292], [0.246429, -0.272522, -0.609924, 0.318604, -0.007355, -0.165756, 1.07019, 1.087708], [0.248596, -0.232468, -0.524887, 0.53009, -0.476334, -0.184479, 1.088089, 0.667358], [0.074478, -0.200455, -0.058411, 0.662811, -0.111923, -0.686462, 1.205154, 1.271912], [0.063065, -0.080765, 0.065552, 0.79071, -0.569946, -0.899506, 0.875687, 0.095215], [0.117706, -0.270584, -0.021027, 0.723694, -0.200073, -0.365158, 0.892624, -0.152466], [0.00148, -0.075348, 0.017761, 0.757507, 0.719299, -0.355362, 0.749329, 0.315247], [0.035034, -0.110794, 0.038559, 0.949677, 0.478699, 0.005951, 0.097305, -0.388245], [-0.101944, -0.392487, 0.401886, 1.154938, 0.199127, 0.117371, -0.070007, -0.562439], [-0.083282, -0.388657, 0.449066, 1.505951, 0.46405, -0.566208, 0.216293, -0.528076], [-0.152054, -0.100113, 0.833054, 1.746857, 0.085861, -1.314102, 0.294632, -0.470947], [-0.166672, -0.183777, 0.988373, 1.925262, -0.202057, -0.961441, 0.15242, 0.594421], [-0.234573, -0.227707, 1.102112, 1.802002, -0.382492, -1.153336, 0.29335, 0.074036], [-0.336426, 0.042435, 1.255096, 1.804535, -0.610153, -0.810745, 1.308441, 0.599854], [-0.359344, 0.007248, 1.344543, 1.441559, -0.758286, -0.800079, 1.0233, 0.668213], [-0.321823, 0.027618, 1.1521, 1.509827, -0.708267, -0.668152, 1.05722, 0.710571], [-0.265335, 0.012344, 1.491501, 1.844971, -0.584137, -1.042419, -0.449188, 0.5354], [-0.302399, 0.049698, 1.440643, 1.674866, -0.626633, -1.158554, -0.906937, 0.405579], [-0.330276, 0.466675, 1.444153, 0.855499, -0.645447, -0.352158, 0.730423, 0.429932], [-0.354721, 0.540207, 1.570786, 0.626648, -0.897446, -0.007416, 0.174042, 0.100525], [-0.239609, 0.669983, 0.978851, 0.85321, -0.156784, 0.107986, 0.915054, 0.114197], [-0.189346, 0.930756, 0.824295, 0.516083, -0.339767, -0.206314, 0.744049, -0.36377]]
#query = [[0.387268, -1.21701, -0.432266, -1.394104, -0.458984, -1.469788, 0.12764, 2.310059], [0.418091, -1.389526, -0.150146, -0.759155, -0.578003, -2.123199, 0.276001, 3.022339], [0.264694, -1.526886, -0.238907, -0.511108, -0.90683, -2.699249, 0.692032, 2.849854], [0.246628, -1.675171, -0.533432, 0.070007, -0.392151, -1.739227, 0.534485, 2.744019], [0.099335, -1.983826, -0.985291, 0.428833, 0.26535, -1.285583, -0.234451, 2.4729], [0.055893, -2.108063, -0.401825, 0.860413, 0.724106, -1.959137, -1.360458, 2.350708], [-0.131592, -1.928314, -0.056213, 0.577698, 0.859146, -1.812286, -1.21669, 2.2052], [-0.162796, -2.149933, 0.467239, 0.524231, 0.74913, -1.829498, -0.741913, 1.616577], [-0.282745, -1.971008, 0.837616, 0.56427, 0.198288, -1.826935, -0.118027, 1.599731], [-0.497223, -1.578705, 1.277298, 0.682983, 0.055084, -2.032562, 0.64151, 1.719238], [-0.634232, -1.433258, 1.760513, 0.550415, -0.053787, -2.188568, 1.666687, 1.611938], [-0.607498, -1.302826, 1.960556, 1.331726, 0.417633, -2.271973, 2.095001, 0.9823], [-0.952957, -0.222076, 0.772064, 2.062256, -0.295258, -1.255371, 3.450974, -0.047607], [-1.210587, 1.00061, 0.036392, 1.952209, 0.470123, 0.231628, 2.670502, -0.608276], [-1.213287, 0.927002, -0.414825, 2.104065, 1.160126, 0.088898, 1.32959, -0.018311], [-1.081558, 1.007751, -0.337509, 1.7146, 0.653687, 0.297089, 1.916733, -0.772461], [-1.064804, 1.284302, -0.393585, 2.150635, 0.132294, 0.443298, 1.967575, 0.775513], [-0.972366, 1.039734, -0.588135, 1.413818, 0.423813, 0.781494, 1.977509, -0.556274], [-0.556381, 0.591309, -0.678314, 1.025635, 1.094284, 2.234711, 1.504013, -1.71875], [-0.063477, 0.626129, 0.360489, 0.149902, 0.92804, 0.936493, 1.203018, 0.264282], [0.162003, 0.577698, 0.956863, -0.477051, 1.081161, 0.817749, 0.660843, -0.428711], [-0.049515, 0.423615, 0.82489, 0.446228, 1.323853, 0.562775, -0.144196, 1.145386], [-0.146851, 0.171906, 0.304871, 0.320435, 1.378937, 0.673004, 0.188416, 0.208618], [0.33992, -2.072418, -0.447968, 0.526794, -0.175858, -1.400299, -0.452454, 1.396606], [0.226089, -2.183441, -0.301071, -0.475159, 0.834961, -2.191864, -1.092361, 2.434814], [0.279556, -2.073181, -0.517639, -0.766479, 0.974808, -2.070374, -2.003891, 2.706421], [0.237961, -1.9245, -0.708435, -0.582153, 1.285934, -1.75882, -2.146164, 2.369995], [0.149658, -1.703705, -0.539749, -0.215332, 1.369705, -1.484802, -1.506256, 1.04126], [0.078735, -1.719543, 0.157013, 0.382385, 1.100998, -0.223755, 0.021683, -0.545654], [0.106003, -1.404358, 0.372345, 1.881165, -0.292511, -0.263855, 1.579529, -1.426025], [0.047729, -1.198608, 0.600769, 1.901123, -1.106949, 0.128815, 1.293701, -1.364258], [0.110748, -0.894348, 0.712601, 1.728699, -1.250381, 0.674377, 0.812302, -1.428833], [0.085754, -0.662903, 0.794312, 1.102844, -1.234283, 1.084442, 0.986938, -1.10022], [0.140823, -0.300323, 0.673508, 0.669983, -0.551453, 1.213074, 1.449326, -1.567261], [0.03743, 0.550293, 0.400909, -0.174622, 0.355301, 1.325867, 0.875854, 0.126953], [-0.084885, 1.128906, 0.292099, -0.248779, 0.722961, 0.873871, -0.409515, 0.470581], [0.019684, 0.947754, 0.19931, -0.306274, 0.176849, 1.431702, 1.091507, 0.701416], [-0.094162, 0.895203, 0.687378, -0.229065, 0.549088, 1.376953, 0.892303, -0.642334], [-0.727692, 0.626495, 0.848877, 0.521362, 1.521912, -0.443481, 1.247238, 0.197388], [-0.82048, 0.117279, 0.975174, 1.487244, 1.085281, -0.567993, 0.776093, -0.381592], [-0.009827, -0.553009, -0.213135, 0.837341, 0.482712, -0.939423, 0.140884, 0.330566], [-0.018127, -1.362335, -0.199265, 1.260742, 0.005188, -1.445068, -1.159653, 1.220825], [0.186172, -1.727814, -0.246552, 1.544128, 0.285416, 0.081848, -1.634003, -0.47522], [0.193649, -1.144043, -0.334854, 1.220276, 1.241302, 1.554382, 0.57048, -1.334961], [0.344604, -1.647461, -0.720749, 0.993774, 0.585709, 0.953522, -0.493042, -1.845703], [0.37471, -1.989471, -0.518555, 0.555908, -0.025787, 0.148132, -1.463425, -0.844849], [0.34523, -1.821625, -0.809418, 0.59137, -0.577927, 0.037903, -2.067764, -0.519531], [0.413193, -1.503876, -0.752243, 0.280396, -0.236206, 0.429932, -1.684097, -0.724731], [0.331299, -1.349243, -0.890121, -0.178589, -0.285721, 0.809875, -2.012329, -0.157227], [0.278946, -1.090057, -0.670441, -0.477539, -0.267105, 0.446045, -1.95668, 0.501343], [0.127304, -0.977112, -0.660324, -1.011658, -0.547409, 0.349182, -1.357574, 1.045654], [0.217728, -0.793182, -0.496262, -1.259949, -0.128937, 0.38855, -1.513306, 1.863647], [0.240143, -0.891541, -0.619995, -1.478577, -0.361481, 0.258362, -1.630585, 1.841064], [0.241547, -0.758453, -0.515442, -1.370605, -0.428238, 0.23996, -1.469406, 1.307617], [0.289948, -0.714661, -0.533798, -1.574036, 0.017929, -0.368317, -1.290283, 0.851563], [0.304916, -0.783752, -0.459915, -1.523621, -0.107651, -0.027649, -1.089905, 0.969238], [0.27179, -0.795593, -0.352432, -1.597656, -0.001678, -0.06189, -1.072495, 0.637329], [0.301956, -0.823578, -0.152115, -1.637634, 0.2034, -0.214508, -1.315491, 0.773071], [0.282486, -0.853271, -0.162094, -1.561096, 0.15686, -0.289307, -1.076874, 0.673706], [0.299881, -0.97052, -0.051086, -1.431152, -0.074692, -0.32428, -1.385452, 0.684326], [0.220886, -1.072266, -0.269531, -1.038269, 0.140533, -0.711273, -1.7453, 1.090332], [0.177628, -1.229126, -0.274292, -0.943481, 0.483246, -1.214447, -2.026321, 0.719971], [0.176987, -1.137543, -0.007645, -0.794861, 0.965118, -1.084717, -2.37677, 0.598267], [0.135727, -1.36795, 0.09462, -0.776367, 0.946655, -1.157959, -2.794403, 0.226074], [0.067337, -1.648987, 0.535721, -0.665833, 1.506119, -1.348755, -3.092728, 0.281616], [-0.038101, -1.437347, 0.983917, -0.280762, 1.880722, -1.351318, -3.002258, -0.599609], [-0.152573, -1.146027, 0.717545, -0.60321, 2.126541, -0.59198, -2.282028, -1.048584], [-0.113525, -0.629669, 0.925323, 0.465393, 2.368698, -0.352661, -1.969391, -0.915161], [-0.140121, -0.311951, 0.884262, 0.809021, 1.557693, -0.552429, -1.776062, -0.925537], [-0.189423, -0.117767, 0.975174, 1.595032, 1.284485, -0.698639, -2.007202, -1.307251], [-0.048874, -0.176941, 0.820679, 1.306519, 0.584259, -0.913147, -0.658066, -0.630981], [-0.127594, 0.33313, 0.791336, 1.400696, 0.685577, -1.500275, -0.657959, -0.207642], [-0.044128, 0.653351, 0.615326, 0.476685, 1.099625, -0.902893, -0.154449, 0.325073], [-0.150223, 1.059845, 1.208405, -0.038635, 0.758667, 0.458038, -0.178909, -0.998657], [-0.099854, 1.127197, 0.789871, -0.013611, 0.452805, 0.736176, 0.948273, -0.236328], [-0.250275, 1.188568, 0.935989, 0.34314, 0.130463, 0.879913, 1.669037, 0.12793], [-0.122818, 1.441223, 0.670029, 0.389526, -0.15274, 1.293549, 1.22908, -1.132568]]
#this one doesn't
reference = [[-0.453598, -2.439209, 0.973587, 1.362091, -0.073654, -1.755112, 1.090057, 4.246765], [-0.448502, -2.621201, 0.723282, 1.257324, 0.26619, -1.375351, 1.328735, 4.46991], [-0.481247, -2.29718, 0.612854, 1.078033, 0.309708, -2.037506, 1.056305, 3.181702], [-0.42482, -2.306702, 0.436157, 1.529907, 0.50708, -1.930069, 0.653198, 3.561768], [-0.39032, -2.361343, 0.589294, 1.965607, 0.611801, -2.417084, 0.035675, 3.381104], [-0.233444, -2.281525, 0.703171, 2.17868, 0.519257, -2.474442, -0.502808, 3.569153], [-0.174652, -1.924591, 0.180267, 2.127075, 0.250626, -2.208527, -0.396591, 2.565552], [-0.121078, -1.53801, 0.234344, 2.221039, 0.845367, -1.516205, -0.174149, 1.298645], [-0.18631, -1.047806, 0.629654, 2.073303, 0.775024, -1.931076, 0.382706, 2.278442], [-0.160477, -0.78743, 0.694214, 1.917572, 0.834885, -1.574707, 0.780045, 2.370422], [-0.203659, -0.427246, 0.726486, 1.548767, 0.465698, -1.185379, 0.555206, 2.619629], [-0.208298, -0.393707, 0.771881, 1.646484, 0.612946, -0.996277, 0.658539, 2.499146], [-0.180679, -0.166656, 0.689209, 1.205994, 0.3918, -1.051483, 0.771072, 1.854553], [-0.1978, 0.082764, 0.723541, 1.019104, 0.165405, -0.127533, 1.0522, 0.552368], [-0.171127, 0.168533, 0.529541, 0.584839, 0.702011, -0.36525, 0.711792, 1.029114], [-0.224243, 0.38765, 0.916031, 0.45108, 0.708923, -0.059326, 1.016312, 0.437561], [-0.217072, -0.981766, 1.67363, 1.864014, 0.050812, -2.572815, -0.22937, 0.757996], [-0.284714, -0.784927, 1.720383, 1.782379, -0.093414, -2.492111, 0.623398, 0.629028], [-0.261169, -0.427979, 1.680038, 1.585358, 0.067093, -1.8181, 1.276291, 0.838989], [-0.183075, -0.08197, 1.094147, 1.120392, -0.117752, -0.86142, 1.94194, 0.966858], [-0.188919, 0.121521, 1.277664, 0.90979, 0.114288, -0.880875, 1.920517, 0.95752], [-0.226868, 0.338455, 0.78067, 0.803009, 0.347092, -0.387955, 0.641296, 0.374634], [-0.206329, 0.768158, 0.759537, 0.264099, 0.15979, 0.152618, 0.911636, -0.011597], [-0.230453, 0.495941, 0.547165, 0.137604, 0.36377, 0.594406, 1.168839, 0.125916], [0.340851, -0.382736, -1.060455, -0.267792, 1.1306, 0.595047, -1.544922, -1.6828], [0.341492, -0.325836, -1.07164, -0.215607, 0.895645, 0.400177, -0.773956, -1.827515], [0.392075, -0.305389, -0.885422, -0.293427, 0.993225, 0.66655, -1.061218, -1.730713], [0.30191, -0.339005, -0.877853, 0.153992, 0.986588, 0.711823, -1.100525, -1.648376], [0.303574, -0.491241, -1.000183, 0.075378, 0.686295, 0.752792, -1.192123, -1.744568], [0.315781, -0.629456, -0.996063, 0.224731, 1.074173, 0.757736, -1.170807, -2.08313], [0.313675, -0.804688, -1.00325, 0.431641, 0.685883, 0.538879, -0.988373, -2.421326], [0.267181, -0.790329, -0.726974, 0.853027, 1.369629, -0.213638, -1.708023, -1.977844], [0.304459, -0.935257, -0.778061, 1.042633, 1.391861, -0.296768, -1.562164, -2.014099], [0.169754, -0.792953, -0.481842, 1.404236, 0.766983, -0.29805, -1.587265, -1.25531], [0.15918, -0.9814, -0.197662, 1.748718, 0.888367, -0.880234, -1.64949, -1.359802], [0.028244, -0.772934, -0.186172, 1.594238, 0.863571, -1.224701, -1.153183, -0.292664], [-0.020401, -0.461578, 0.368088, 1.000366, 1.079636, -0.389603, -0.144409, 0.651733], [0.018555, -0.725418, 0.632599, 1.707336, 0.535049, -1.783859, -0.916122, 1.557007], [-0.038971, -0.797668, 0.820419, 1.483093, 0.350494, -1.465073, -0.786453, 1.370361], [-0.244888, -0.469513, 1.067978, 1.028809, 0.4879, -1.796585, -0.77887, 1.888977], [-0.260193, -0.226593, 1.141754, 1.21228, 0.214005, -1.200943, -0.441177, 0.532715], [-0.165283, 0.016129, 1.263016, 0.745514, -0.211288, -0.802368, 0.215698, 0.316406], [-0.353134, 0.053787, 1.544189, 0.21106, -0.469086, -0.485367, 0.767761, 0.849548], [-0.330215, 0.162704, 1.570053, 0.304718, -0.561172, -0.410294, 0.895126, 0.858093], [-0.333847, 0.173904, 1.56958, 0.075531, -0.5569, -0.259552, 1.276764, 0.749084], [-0.347107, 0.206665, 1.389832, 0.50473, -0.721664, -0.56955, 1.542618, 0.817444], [-0.299057, 0.140244, 1.402924, 0.215363, -0.62767, -0.550461, 1.60788, 0.506958], [-0.292084, 0.052063, 1.463348, 0.290497, -0.462875, -0.497452, 1.280609, 0.261841], [-0.279877, 0.183548, 1.308609, 0.305756, -0.6483, -0.374771, 1.647781, 0.161865], [-0.28389, 0.27916, 1.148636, 0.466736, -0.724442, -0.21991, 1.819901, -0.218872], [-0.275528, 0.309753, 1.192856, 0.398163, -0.828781, -0.268066, 1.763672, 0.116089], [-0.275284, 0.160019, 1.200623, 0.718628, -0.925552, -0.026596, 1.367447, 0.174866], [-0.302795, 0.383438, 1.10556, 0.441833, -0.968323, -0.137375, 1.851791, 0.357971], [-0.317078, 0.22876, 1.272217, 0.462219, -0.855789, -0.294296, 1.593994, 0.127502], [-0.304932, 0.207718, 1.156189, 0.481506, -0.866776, -0.340027, 1.670105, 0.657837], [-0.257217, 0.155655, 1.041428, 0.717926, -0.761597, -0.17244, 1.114151, 0.653503], [-0.321426, 0.292358, 0.73848, 0.422607, -0.850754, -0.057907, 1.462357, 0.697754], [-0.34642, 0.361526, 0.69722, 0.585175, -0.464508, -0.26651, 1.860596, 0.106201], [-0.339844, 0.584229, 0.542603, 0.184937, -0.341263, 0.085648, 1.837311, 0.160461], [-0.32338, 0.661224, 0.512833, 0.319702, -0.195572, 0.004028, 1.046799, 0.233704], [-0.346329, 0.572388, 0.385986, 0.118988, 0.057556, 0.039001, 1.255081, -0.18573], [-0.383392, 0.558395, 0.553391, -0.358612, 0.443573, -0.086014, 0.652878, 0.829956], [-0.420395, 0.668991, 0.64856, -0.021271, 0.511475, 0.639221, 0.860474, 0.463196], [-0.359039, 0.748672, 0.522964, -0.308899, 0.717194, 0.218811, 0.681396, 0.606812], [-0.323914, 0.942627, 0.249069, -0.418365, 0.673599, 0.797974, 0.162674, 0.120361], [-0.411301, 0.92775, 0.493332, -0.286346, 0.165054, 0.63446, 1.085571, 0.120789], [-0.346191, 0.632309, 0.635056, -0.402496, 0.143814, 0.785614, 0.952164, 0.482727], [-0.203812, 0.789261, 0.240433, -0.47699, -0.12912, 0.91832, 1.145493, 0.052002], [-0.048203, 0.632095, 0.009583, -0.53833, 0.232727, 1.293045, 0.308151, 0.188904], [-0.062393, 0.732315, 0.06694, -0.697144, 0.126221, 0.864578, 0.581635, -0.088379]]
query = [[-0.113144, -3.316223, -1.101563, -2.128418, 1.853867, 3.61972, 1.218185, 1.71228], [-0.128952, -3.37915, -1.152237, -2.033081, 1.860199, 4.008179, 0.445938, 1.665894], [-0.0392, -2.976654, -0.888245, -1.613953, 1.638641, 3.849518, 0.034073, 0.768188], [-0.146042, -2.980713, -1.044113, -1.44397, 0.954514, 3.20929, -0.232422, 1.050781], [-0.155029, -2.997192, -1.064438, -1.369873, 0.67688, 2.570709, -0.855347, 1.523438], [-0.102341, -2.686401, -1.029648, -1.00531, 0.950089, 1.933228, -0.526367, 1.598633], [-0.060272, -2.538727, -1.278259, -0.65332, 0.630875, 1.459717, -0.264038, 1.872925], [0.064087, -2.592682, -1.112823, -0.775024, 0.848618, 0.810883, 0.298965, 2.312134], [0.111557, -2.815277, -1.203506, -1.173584, 0.54863, 0.46756, -0.023071, 3.029053], [0.266068, -2.624786, -1.089066, -0.864136, 0.055389, 0.619446, -0.160965, 2.928589], [0.181488, -2.31073, -1.307785, -0.720276, 0.001297, 0.534668, 0.495499, 2.989502], [0.216202, -2.25354, -1.288193, -0.902039, -0.152283, -0.060791, 0.566315, 2.911621], [0.430084, -2.0289, -1.099594, -1.091736, -0.302505, -0.087799, 0.955963, 2.677002], [0.484253, -1.412842, -0.881882, -1.087158, -1.064072, -0.145935, 1.437683, 2.606567], [0.339081, -1.277222, -1.24498, -1.048279, -0.219498, 0.448517, 1.168625, 0.563843], [0.105728, 0.138275, -1.01413, -0.489868, 1.319275, 1.604645, 1.634003, -0.94812], [-0.209061, 1.025665, 0.180405, 0.955566, 1.527405, 0.91745, 1.951233, -0.40686], [-0.136993, 1.332275, 0.639862, 1.277832, 1.277313, 0.361267, 0.390717, -0.728394], [-0.217758, 1.416718, 1.080002, 0.816101, 0.343933, -0.154175, 1.10347, -0.568848]]
reference = np.array( reference )
query = np.array( query )
rpy2.robjects.numpy2ri.activate()
# Set up our R namespaces
R = rpy2.robjects.r
rNull = R("NULL")
rprint = rpy2.robjects.globalenv.get("print")
rplot = rpy2.robjects.r('plot')
distConstr = rpy2.robjects.r('proxy::dist')
DTW = importr('dtw')
stepName = "asymmetricP05"
stepPattern = rpy2.robjects.r( stepName )
canDist = distConstr( reference, query, "Euclidean" ) #
alignment = R.dtw(canDist, rNull, "Euclidean", stepPattern, "none", True, False, True, False )
For some series the script doesn't generate the error but there are some which do. See the commented lines for examples. It is worth noting that for the classic constraint this error does not appear. I am thinking that perhaps I have not set-up something correct but I am no expert in python nor in R so that is why I was hoping that others who have used the R DTW can help me on this. I am sorry for the long lines for reference and query (the data is from outputting the MFCC's of a 2 second wav file).
One of the two series is too short to be compatible with the fancy step pattern you chose. Use the common symmetric2 pattern, which does not restrict slopes, before the more exotic ones.

Categories

Resources