vendredi 30 octobre 2020

Python: How to create a DataFrame in which last column (i.e. fifth column) is the addition of first four column

A   B   C   D  Total
2   2   1   2   7
1   1   3   1   6
2   2   1   1   6
1   2   1   1   5

Here Column A, B, C, and D are generated using np.random.randint(1,3,size=4). Total is the addition of A, B, C, and D (i.e., Total = A+B+C+D). Only the Condition is the Value of Total should be more than 7.




Aucun commentaire:

Enregistrer un commentaire