hi, i’m have some data
x = [
[-1.8, 1.12, 50.6],
[-3.2,4.8,6.8],
[2.6,14.04,16.8],
]
cons_data = [
[1,4],
[1,7,14],
[1,5,6,38],
]
need cerate def
def test_func(x,cons_data ):
need return res
[-1.8, 1.12, 50.6] == check -1.8 =>int =  -2  not [1,4] => give rand 1 or 4  = 4
[-1.8, 1.12, 50.6] == check 1.12 =>int = 1  In [1,7,14] => == 1.12
[-1.8, 1.12, 50.6]   check  50.6 =>int = 51 not [1,5,6,38] => give rand 1 or 5 or 6 or 38   = 5
res x[0] ==>   [-1.8, 1.12, 50.6]   ==> [4.0, 1.12, 5.0]
full res examle
res [
[4.0, 1.12, 5.0] ,
[1.0, 7.0, 14.0] ,
[1.0, 14.04, 38.0] ,
]
solusho
solusho

  

      ru.stackoverflow.com
  

  
      
    
  


  python array create function



  python, массивы



  asked by
  
  
    Vit Saha
  
  on 02:15PM - 04 Oct 21 UTC