I want to randomly replace 2 of the customer values in the table to 0. The table can have as many rows as possible but the primary key of the table is cust.
How do i do this in pyspark?
SAMPLE:
Input
| cust | value|
| c1 | 2 |
| c2 | 4 |
| c4 | 6 |
| c3 | 8 |
| c5 | 10 |
| c6 | 12 |
Output
| cust | value|
| c1 | 2 |
| c2 | 0 |
| c4 | 6 |
| c3 | 8 |
| c5 | 0 |
| c6 | 12 |