I am trying to add null values at random to a pandas data for a specific column to perform testing on the data. For example if i have a dataframe with below values.
id | total_distance |
---|---|
1 | 1000 |
1 | 2000 |
3 | 4000 |
4 | 5000 |
5 | 10000 |
How to pass null values at random like below
id | total_distance |
---|---|
1 | 1000 |
1 | 2000 |
3 | 4000 |
4 | NaN |
5 | 10000 |
没有评论:
发表评论