I'm trying to conditionally add random values within the expected range.
data =
LOT NO QTY(Kgs) % PICK 11C 12C 13C 14C 15C 16C
H19 312 6.22
H20 936 18.67
H21 989 19.72
H22 559 11.15
H23 639 12.74
H24 736 14.68
H25 843 16.81
Where 11c to 16C are columns with null values(nans) or zeros.
I want to add or replace with random values(int & float) with a set of conditions
- The avg sum of the values in column
11Cshould be in the range between 9-12.5. - The avg sum of the values in column
12Cshould be in the range between 43-47. 3. 4. Other conditions are below
11C | 12C | 13C | 14C | 15C | 16C
--------------------------------------------------------------
9-12.5 | 45+/-2 | 205-230 | 5.0-6.0 | <1000 | <1500
---------------------------------------------------------------
My Expected Output:
LOT NO QTY (Kgs) % PICK 11C 12C 13C 14C 15C 16C
H19 312 6.22 10.50 45.30 247 5.46 53 430
H20 936 18.67 10.38 48.48 265 5.64 67 280
H21 989 19.72 10.62 44.38 264 5.66 73 325
H22 559 11.15 10.97 43.52 226 5.54 62 365
H23 639 12.74 10.89 46.53 205 5.71 84 345
H24 736 14.68 11.09 43.76 165 5.62 93 230
H25 843 16.81 11.01 39.96 137 5.68 95 160
How can I do that?