I have got daily MIS Fields are " Name,Number and Location ". Now, Total I have 100 Rows data daily basis and I have to first check that the numbers are in 10 digit or not, if Number fields are 1 to 9 digit , i have to remove that entry in my MIS,
only valid number like 10 digit and additional +91 before 10 digit number is valid. so, in excel i have to daily remove that invalid numbers and all its manually.
next i have to send it to valid number in 2 branches.50% valid number in 1st branch and 50% valid number in 2nd branch,
In 1st branch there are two persons, so again I have to send to both person equally valid number data entry. So, For example : if out of 100 data rows, total valid number is 60 , Then in 1st branch total 30 valid numbers occurs, and each two person get 15-15 numbers.
In 2nd branch there are three persons, valid 30 numbers occurs and each three get 10-10-10 numbers.
Any help it will grateful.
Here is my code.
import pandas as pd
import numpy as np
df = pd.read_csv('/home/desktop/Desktop/MIS.csv')
df
Name Number Location
0 Jayesh 980000 Pune
1 Ajay 9890989090 Mumbai
2 Manish 9999999999 Pune
3 Vikram 919000000000 Pune
4 Prakash 919999999999 Mumbai
5 Rakesh 919999999998 Mumbai
6 Naresh 9000 Pune
df['Number']=df['Number'].astype(str).apply(lambda x: np.where((len(x)<=10)))