Commit ·
d64c2d2
1
Parent(s): bebc88d
update
Browse files- Directory spreadsheet.xlsx +0 -3
- ams.py +14 -12
- contacts.json +0 -0
- preprocessing.ipynb +121 -125
Directory spreadsheet.xlsx
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:f250e5c0445ea7e798175e36bed5ba6726ce9bc0d34d3b3c210b89439ec85a17
|
| 3 |
-
size 75979
|
|
|
|
|
|
|
|
|
|
|
|
ams.py
CHANGED
|
@@ -25,20 +25,20 @@ driver.get("https://web.whatsapp.com/")
|
|
| 25 |
print("Scan the QR Code to log in...")
|
| 26 |
time.sleep(25) # Wait for login
|
| 27 |
|
|
|
|
| 28 |
for item in contacts:
|
| 29 |
|
| 30 |
-
raw_message = f"""
|
| 31 |
-
|
| 32 |
🏢 *উত্তরায় স্মার্ট লিভিং, প্রিমিয়াম ভ্যালু।*
|
| 33 |
-
|
| 34 |
✨ রেডি ও অনগোয়িং ফ্ল্যাট।
|
| 35 |
⏳ সীমিত ইউনিট, তাই সুযোগ হাতছাড়া করবেন না!
|
| 36 |
✅ থাকার জন্য বা ইনভেস্টমেন্ট—দুই ক্ষেত্রেই সঠিক সময়।
|
| 37 |
-
|
| 38 |
📞 আজই কল করুন / রিপ্লাই দিন “VISIT”
|
| 39 |
-
|
| 40 |
🏠 *better engineering ltd (bel)*"""
|
| 41 |
-
|
| 42 |
message = quote(raw_message, safe='')
|
| 43 |
|
| 44 |
url = f"https://web.whatsapp.com/send?phone=88{item['number']}&text={message}"
|
|
@@ -46,19 +46,21 @@ for item in contacts:
|
|
| 46 |
|
| 47 |
try:
|
| 48 |
# Wait until the message box is visible
|
| 49 |
-
msg_box = WebDriverWait(driver,
|
| 50 |
EC.presence_of_element_located((By.XPATH, '//div[@contenteditable="true"][@data-tab="10"]'))
|
| 51 |
)
|
| 52 |
|
| 53 |
# Press ENTER to send message
|
| 54 |
msg_box.send_keys(Keys.ENTER)
|
| 55 |
-
print(f"Message sent to {item['name']} -> {item['number']}")
|
| 56 |
successful_numbers.append({item['name']: item['number']})
|
| 57 |
time.sleep(3)
|
| 58 |
-
|
|
|
|
| 59 |
except Exception as e:
|
| 60 |
-
print(f"Failed to send message to {item['name']} -> {item['number']}: {e}")
|
| 61 |
failed_numbers.append({item['name']: item['number']})
|
|
|
|
| 62 |
|
| 63 |
driver.quit()
|
| 64 |
|
|
@@ -66,13 +68,13 @@ driver.quit()
|
|
| 66 |
if successful_numbers:
|
| 67 |
with open("successful_numbers.json", "w") as f:
|
| 68 |
json.dump(successful_numbers, f)
|
| 69 |
-
print("Successful numbers saved to successful_numbers.json")
|
| 70 |
else:
|
| 71 |
print("No successful numbers 😢")
|
| 72 |
|
| 73 |
if failed_numbers:
|
| 74 |
with open("failed_numbers.json", "w") as f:
|
| 75 |
json.dump(failed_numbers, f)
|
| 76 |
-
print("Failed numbers saved to failed_numbers.json")
|
| 77 |
else:
|
| 78 |
print("No failed numbers 🎉")
|
|
|
|
| 25 |
print("Scan the QR Code to log in...")
|
| 26 |
time.sleep(25) # Wait for login
|
| 27 |
|
| 28 |
+
counter = 1
|
| 29 |
for item in contacts:
|
| 30 |
|
| 31 |
+
raw_message = f"""
|
|
|
|
| 32 |
🏢 *উত্তরায় স্মার্ট লিভিং, প্রিমিয়াম ভ্যালু।*
|
| 33 |
+
|
| 34 |
✨ রেডি ও অনগোয়িং ফ্ল্যাট।
|
| 35 |
⏳ সীমিত ইউনিট, তাই সুযোগ হাতছাড়া করবেন না!
|
| 36 |
✅ থাকার জন্য বা ইনভেস্টমেন্ট—দুই ক্ষেত্রেই সঠিক সময়।
|
| 37 |
+
|
| 38 |
📞 আজই কল করুন / রিপ্লাই দিন “VISIT”
|
| 39 |
+
|
| 40 |
🏠 *better engineering ltd (bel)*"""
|
| 41 |
+
|
| 42 |
message = quote(raw_message, safe='')
|
| 43 |
|
| 44 |
url = f"https://web.whatsapp.com/send?phone=88{item['number']}&text={message}"
|
|
|
|
| 46 |
|
| 47 |
try:
|
| 48 |
# Wait until the message box is visible
|
| 49 |
+
msg_box = WebDriverWait(driver, 15).until(
|
| 50 |
EC.presence_of_element_located((By.XPATH, '//div[@contenteditable="true"][@data-tab="10"]'))
|
| 51 |
)
|
| 52 |
|
| 53 |
# Press ENTER to send message
|
| 54 |
msg_box.send_keys(Keys.ENTER)
|
| 55 |
+
print(f"Message {counter} sent to {item['name']} -> {item['number']}")
|
| 56 |
successful_numbers.append({item['name']: item['number']})
|
| 57 |
time.sleep(3)
|
| 58 |
+
counter += 1
|
| 59 |
+
|
| 60 |
except Exception as e:
|
| 61 |
+
print(f"Failed to send message {counter} to {item['name']} -> {item['number']}: {e}")
|
| 62 |
failed_numbers.append({item['name']: item['number']})
|
| 63 |
+
counter += 1
|
| 64 |
|
| 65 |
driver.quit()
|
| 66 |
|
|
|
|
| 68 |
if successful_numbers:
|
| 69 |
with open("successful_numbers.json", "w") as f:
|
| 70 |
json.dump(successful_numbers, f)
|
| 71 |
+
print(f"Successful numbers {len(successful_numbers)} saved to successful_numbers.json")
|
| 72 |
else:
|
| 73 |
print("No successful numbers 😢")
|
| 74 |
|
| 75 |
if failed_numbers:
|
| 76 |
with open("failed_numbers.json", "w") as f:
|
| 77 |
json.dump(failed_numbers, f)
|
| 78 |
+
print(f"Failed numbers {len(failed_numbers)} saved to failed_numbers.json")
|
| 79 |
else:
|
| 80 |
print("No failed numbers 🎉")
|
contacts.json
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
preprocessing.ipynb
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
"cells": [
|
| 3 |
{
|
| 4 |
"cell_type": "code",
|
| 5 |
-
"execution_count":
|
| 6 |
"id": "d77bdb7b",
|
| 7 |
"metadata": {},
|
| 8 |
"outputs": [
|
|
@@ -10,13 +10,13 @@
|
|
| 10 |
"name": "stdout",
|
| 11 |
"output_type": "stream",
|
| 12 |
"text": [
|
| 13 |
-
"Total rows:
|
| 14 |
-
"
|
| 15 |
-
"0
|
| 16 |
-
"1
|
| 17 |
-
"2
|
| 18 |
-
"3
|
| 19 |
-
"4
|
| 20 |
]
|
| 21 |
}
|
| 22 |
],
|
|
@@ -26,7 +26,7 @@
|
|
| 26 |
"\n",
|
| 27 |
"# warnings.filterwarnings(\"ignore\", category=UserWarning)\n",
|
| 28 |
"\n",
|
| 29 |
-
"file = \"
|
| 30 |
"\n",
|
| 31 |
"df = pd.read_excel(\n",
|
| 32 |
" file,\n",
|
|
@@ -46,7 +46,7 @@
|
|
| 46 |
},
|
| 47 |
{
|
| 48 |
"cell_type": "code",
|
| 49 |
-
"execution_count":
|
| 50 |
"id": "76e2e1f0",
|
| 51 |
"metadata": {},
|
| 52 |
"outputs": [
|
|
@@ -55,14 +55,14 @@
|
|
| 55 |
"output_type": "stream",
|
| 56 |
"text": [
|
| 57 |
"<class 'pandas.core.frame.DataFrame'>\n",
|
| 58 |
-
"
|
| 59 |
"Data columns (total 2 columns):\n",
|
| 60 |
" # Column Non-Null Count Dtype \n",
|
| 61 |
"--- ------ -------------- ----- \n",
|
| 62 |
-
" 0 Name
|
| 63 |
-
" 1 Number
|
| 64 |
"dtypes: object(2)\n",
|
| 65 |
-
"memory usage:
|
| 66 |
]
|
| 67 |
}
|
| 68 |
],
|
|
@@ -72,19 +72,19 @@
|
|
| 72 |
},
|
| 73 |
{
|
| 74 |
"cell_type": "code",
|
| 75 |
-
"execution_count":
|
| 76 |
"id": "3dc2adc0",
|
| 77 |
"metadata": {},
|
| 78 |
"outputs": [
|
| 79 |
{
|
| 80 |
"data": {
|
| 81 |
"text/plain": [
|
| 82 |
-
"Name
|
| 83 |
-
"Number
|
| 84 |
"dtype: bool"
|
| 85 |
]
|
| 86 |
},
|
| 87 |
-
"execution_count":
|
| 88 |
"metadata": {},
|
| 89 |
"output_type": "execute_result"
|
| 90 |
}
|
|
@@ -95,7 +95,7 @@
|
|
| 95 |
},
|
| 96 |
{
|
| 97 |
"cell_type": "code",
|
| 98 |
-
"execution_count":
|
| 99 |
"id": "116b9212",
|
| 100 |
"metadata": {},
|
| 101 |
"outputs": [
|
|
@@ -103,9 +103,8 @@
|
|
| 103 |
"name": "stdout",
|
| 104 |
"output_type": "stream",
|
| 105 |
"text": [
|
| 106 |
-
"
|
| 107 |
-
"
|
| 108 |
-
"Index: []\n"
|
| 109 |
]
|
| 110 |
}
|
| 111 |
],
|
|
@@ -117,17 +116,29 @@
|
|
| 117 |
},
|
| 118 |
{
|
| 119 |
"cell_type": "code",
|
| 120 |
-
"execution_count":
|
| 121 |
"id": "1cd12680",
|
| 122 |
"metadata": {},
|
| 123 |
-
"outputs": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 124 |
"source": [
|
| 125 |
"df.dropna(inplace=True) # remove rows with missing values"
|
| 126 |
]
|
| 127 |
},
|
| 128 |
{
|
| 129 |
"cell_type": "code",
|
| 130 |
-
"execution_count":
|
| 131 |
"id": "ce33dead",
|
| 132 |
"metadata": {},
|
| 133 |
"outputs": [
|
|
@@ -139,7 +150,7 @@
|
|
| 139 |
"dtype: bool"
|
| 140 |
]
|
| 141 |
},
|
| 142 |
-
"execution_count":
|
| 143 |
"metadata": {},
|
| 144 |
"output_type": "execute_result"
|
| 145 |
}
|
|
@@ -150,7 +161,7 @@
|
|
| 150 |
},
|
| 151 |
{
|
| 152 |
"cell_type": "code",
|
| 153 |
-
"execution_count":
|
| 154 |
"id": "18faac6b",
|
| 155 |
"metadata": {},
|
| 156 |
"outputs": [
|
|
@@ -159,18 +170,18 @@
|
|
| 159 |
"output_type": "stream",
|
| 160 |
"text": [
|
| 161 |
"Number\n",
|
| 162 |
-
"
|
| 163 |
-
"
|
| 164 |
-
"
|
| 165 |
-
"
|
| 166 |
-
"
|
| 167 |
-
"
|
| 168 |
-
"
|
| 169 |
-
"
|
| 170 |
-
"
|
| 171 |
-
"
|
| 172 |
-
"
|
| 173 |
-
"Name: count, Length:
|
| 174 |
]
|
| 175 |
}
|
| 176 |
],
|
|
@@ -182,7 +193,7 @@
|
|
| 182 |
},
|
| 183 |
{
|
| 184 |
"cell_type": "code",
|
| 185 |
-
"execution_count":
|
| 186 |
"id": "32d94a22",
|
| 187 |
"metadata": {},
|
| 188 |
"outputs": [
|
|
@@ -191,56 +202,56 @@
|
|
| 191 |
"output_type": "stream",
|
| 192 |
"text": [
|
| 193 |
" Name Number\n",
|
| 194 |
-
"
|
| 195 |
-
"
|
| 196 |
-
"
|
| 197 |
-
"
|
| 198 |
-
"
|
| 199 |
-
"
|
| 200 |
-
"
|
| 201 |
-
"
|
| 202 |
-
"
|
| 203 |
-
"
|
| 204 |
-
"
|
| 205 |
-
"
|
| 206 |
-
"
|
| 207 |
-
"
|
| 208 |
-
"
|
| 209 |
-
"
|
| 210 |
-
"
|
| 211 |
-
"
|
| 212 |
-
"
|
| 213 |
-
"
|
| 214 |
-
"
|
| 215 |
-
"
|
| 216 |
-
"
|
| 217 |
-
"
|
| 218 |
-
"
|
| 219 |
-
"
|
| 220 |
-
"
|
| 221 |
-
"
|
| 222 |
-
"
|
| 223 |
-
"
|
| 224 |
-
"
|
| 225 |
-
"
|
| 226 |
-
"
|
| 227 |
-
"
|
| 228 |
-
"
|
| 229 |
-
"
|
| 230 |
-
"
|
| 231 |
-
"
|
| 232 |
-
"
|
| 233 |
-
"
|
| 234 |
-
"
|
| 235 |
-
"
|
| 236 |
-
"
|
| 237 |
-
"
|
| 238 |
-
"
|
| 239 |
-
"
|
| 240 |
-
"
|
| 241 |
-
"
|
| 242 |
-
"
|
| 243 |
-
"
|
| 244 |
]
|
| 245 |
}
|
| 246 |
],
|
|
@@ -251,7 +262,7 @@
|
|
| 251 |
},
|
| 252 |
{
|
| 253 |
"cell_type": "code",
|
| 254 |
-
"execution_count":
|
| 255 |
"id": "0f5af544",
|
| 256 |
"metadata": {},
|
| 257 |
"outputs": [
|
|
@@ -259,9 +270,9 @@
|
|
| 259 |
"name": "stdout",
|
| 260 |
"output_type": "stream",
|
| 261 |
"text": [
|
| 262 |
-
"Before:
|
| 263 |
-
"After :
|
| 264 |
-
"Removed:
|
| 265 |
]
|
| 266 |
}
|
| 267 |
],
|
|
@@ -277,7 +288,7 @@
|
|
| 277 |
},
|
| 278 |
{
|
| 279 |
"cell_type": "code",
|
| 280 |
-
"execution_count":
|
| 281 |
"id": "6c1e477b",
|
| 282 |
"metadata": {},
|
| 283 |
"outputs": [
|
|
@@ -285,11 +296,11 @@
|
|
| 285 |
"name": "stdout",
|
| 286 |
"output_type": "stream",
|
| 287 |
"text": [
|
| 288 |
-
"0
|
| 289 |
-
"1
|
| 290 |
-
"2
|
| 291 |
-
"3
|
| 292 |
-
"4
|
| 293 |
"Name: Number, dtype: object\n"
|
| 294 |
]
|
| 295 |
}
|
|
@@ -306,7 +317,7 @@
|
|
| 306 |
},
|
| 307 |
{
|
| 308 |
"cell_type": "code",
|
| 309 |
-
"execution_count":
|
| 310 |
"id": "a61f5286",
|
| 311 |
"metadata": {},
|
| 312 |
"outputs": [
|
|
@@ -314,7 +325,7 @@
|
|
| 314 |
"name": "stdout",
|
| 315 |
"output_type": "stream",
|
| 316 |
"text": [
|
| 317 |
-
"[{'name': '
|
| 318 |
]
|
| 319 |
}
|
| 320 |
],
|
|
@@ -336,7 +347,7 @@
|
|
| 336 |
},
|
| 337 |
{
|
| 338 |
"cell_type": "code",
|
| 339 |
-
"execution_count":
|
| 340 |
"id": "aa5aecb4",
|
| 341 |
"metadata": {},
|
| 342 |
"outputs": [
|
|
@@ -344,8 +355,8 @@
|
|
| 344 |
"name": "stdout",
|
| 345 |
"output_type": "stream",
|
| 346 |
"text": [
|
| 347 |
-
"[{'name': '
|
| 348 |
-
"Total valid numbers:
|
| 349 |
]
|
| 350 |
}
|
| 351 |
],
|
|
@@ -367,7 +378,7 @@
|
|
| 367 |
},
|
| 368 |
{
|
| 369 |
"cell_type": "code",
|
| 370 |
-
"execution_count":
|
| 371 |
"id": "4755835a",
|
| 372 |
"metadata": {},
|
| 373 |
"outputs": [
|
|
@@ -376,22 +387,7 @@
|
|
| 376 |
"output_type": "stream",
|
| 377 |
"text": [
|
| 378 |
"Duplicate numbers found:\n",
|
| 379 |
-
"{'name': '
|
| 380 |
-
"{'name': 'Zebun Nahar Huq', 'number': '01715056151'}\n",
|
| 381 |
-
"{'name': 'Nazia khan', 'number': '01711523376'}\n",
|
| 382 |
-
"{'name': 'Helen Jerin Khan', 'number': '01711676725'}\n",
|
| 383 |
-
"{'name': 'Sabikun Nahar Khan', 'number': '01819238099'}\n",
|
| 384 |
-
"{'name': 'Manzia rahman', 'number': '01819211108'}\n",
|
| 385 |
-
"{'name': 'Nilufa Salim', 'number': '01713036434'}\n",
|
| 386 |
-
"{'name': 'Md Anwar Hossain Khan', 'number': '01711531113'}\n",
|
| 387 |
-
"{'name': 'zakir Mohammad Hossain', 'number': '01711593168'}\n",
|
| 388 |
-
"{'name': 'Md Awal Hossain', 'number': '01711898393'}\n",
|
| 389 |
-
"{'name': 'Nazma Chowdhury', 'number': '01711854367'}\n",
|
| 390 |
-
"{'name': 'G.H. Chowdhury', 'number': '01707251499'}\n",
|
| 391 |
-
"{'name': 'Mizanur Rahman Chowdhury', 'number': '01711560109'}\n",
|
| 392 |
-
"{'name': 'Mahmud Harun Choudhury', 'number': '01714441000'}\n",
|
| 393 |
-
"{'name': 'Enam Ahmed Chowdhury', 'number': '01711567590'}\n",
|
| 394 |
-
"{'name': 'Dilruba Chowdhury', 'number': '01713002300'}\n"
|
| 395 |
]
|
| 396 |
}
|
| 397 |
],
|
|
@@ -414,7 +410,7 @@
|
|
| 414 |
},
|
| 415 |
{
|
| 416 |
"cell_type": "code",
|
| 417 |
-
"execution_count":
|
| 418 |
"id": "1c62c0de",
|
| 419 |
"metadata": {},
|
| 420 |
"outputs": [
|
|
@@ -423,7 +419,7 @@
|
|
| 423 |
"output_type": "stream",
|
| 424 |
"text": [
|
| 425 |
"After removing duplicates:\n",
|
| 426 |
-
"
|
| 427 |
]
|
| 428 |
}
|
| 429 |
],
|
|
@@ -443,7 +439,7 @@
|
|
| 443 |
},
|
| 444 |
{
|
| 445 |
"cell_type": "code",
|
| 446 |
-
"execution_count":
|
| 447 |
"id": "78c1adec",
|
| 448 |
"metadata": {},
|
| 449 |
"outputs": [],
|
|
|
|
| 2 |
"cells": [
|
| 3 |
{
|
| 4 |
"cell_type": "code",
|
| 5 |
+
"execution_count": 2,
|
| 6 |
"id": "d77bdb7b",
|
| 7 |
"metadata": {},
|
| 8 |
"outputs": [
|
|
|
|
| 10 |
"name": "stdout",
|
| 11 |
"output_type": "stream",
|
| 12 |
"text": [
|
| 13 |
+
"Total rows: 2497\n",
|
| 14 |
+
" Name Number\n",
|
| 15 |
+
"0 MD. MAHBUBER RAHMAN CHOWDHURY LCL 1912101010\n",
|
| 16 |
+
"1 MD. MOSTAFIZUR RAHMAN LCL 1768384465\n",
|
| 17 |
+
"2 MOSTAFA FAISAL MAHMUD LCL 1886964400\n",
|
| 18 |
+
"3 DEWAN MD. MOINUL ISLAM MILON LCL 1944730552\n",
|
| 19 |
+
"4 M A BATEN LCL 1732201199\n"
|
| 20 |
]
|
| 21 |
}
|
| 22 |
],
|
|
|
|
| 26 |
"\n",
|
| 27 |
"# warnings.filterwarnings(\"ignore\", category=UserWarning)\n",
|
| 28 |
"\n",
|
| 29 |
+
"file = \"xl.xlsx\"\n",
|
| 30 |
"\n",
|
| 31 |
"df = pd.read_excel(\n",
|
| 32 |
" file,\n",
|
|
|
|
| 46 |
},
|
| 47 |
{
|
| 48 |
"cell_type": "code",
|
| 49 |
+
"execution_count": 3,
|
| 50 |
"id": "76e2e1f0",
|
| 51 |
"metadata": {},
|
| 52 |
"outputs": [
|
|
|
|
| 55 |
"output_type": "stream",
|
| 56 |
"text": [
|
| 57 |
"<class 'pandas.core.frame.DataFrame'>\n",
|
| 58 |
+
"Index: 2497 entries, 0 to 2502\n",
|
| 59 |
"Data columns (total 2 columns):\n",
|
| 60 |
" # Column Non-Null Count Dtype \n",
|
| 61 |
"--- ------ -------------- ----- \n",
|
| 62 |
+
" 0 Name 2496 non-null object\n",
|
| 63 |
+
" 1 Number 2496 non-null object\n",
|
| 64 |
"dtypes: object(2)\n",
|
| 65 |
+
"memory usage: 58.5+ KB\n"
|
| 66 |
]
|
| 67 |
}
|
| 68 |
],
|
|
|
|
| 72 |
},
|
| 73 |
{
|
| 74 |
"cell_type": "code",
|
| 75 |
+
"execution_count": 4,
|
| 76 |
"id": "3dc2adc0",
|
| 77 |
"metadata": {},
|
| 78 |
"outputs": [
|
| 79 |
{
|
| 80 |
"data": {
|
| 81 |
"text/plain": [
|
| 82 |
+
"Name True\n",
|
| 83 |
+
"Number True\n",
|
| 84 |
"dtype: bool"
|
| 85 |
]
|
| 86 |
},
|
| 87 |
+
"execution_count": 4,
|
| 88 |
"metadata": {},
|
| 89 |
"output_type": "execute_result"
|
| 90 |
}
|
|
|
|
| 95 |
},
|
| 96 |
{
|
| 97 |
"cell_type": "code",
|
| 98 |
+
"execution_count": 5,
|
| 99 |
"id": "116b9212",
|
| 100 |
"metadata": {},
|
| 101 |
"outputs": [
|
|
|
|
| 103 |
"name": "stdout",
|
| 104 |
"output_type": "stream",
|
| 105 |
"text": [
|
| 106 |
+
" Name Number\n",
|
| 107 |
+
"2346 Golam Mostofa NaN\n"
|
|
|
|
| 108 |
]
|
| 109 |
}
|
| 110 |
],
|
|
|
|
| 116 |
},
|
| 117 |
{
|
| 118 |
"cell_type": "code",
|
| 119 |
+
"execution_count": 6,
|
| 120 |
"id": "1cd12680",
|
| 121 |
"metadata": {},
|
| 122 |
+
"outputs": [
|
| 123 |
+
{
|
| 124 |
+
"name": "stderr",
|
| 125 |
+
"output_type": "stream",
|
| 126 |
+
"text": [
|
| 127 |
+
"/tmp/ipykernel_1714444/1091212656.py:1: SettingWithCopyWarning: \n",
|
| 128 |
+
"A value is trying to be set on a copy of a slice from a DataFrame\n",
|
| 129 |
+
"\n",
|
| 130 |
+
"See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
|
| 131 |
+
" df.dropna(inplace=True) # remove rows with missing values\n"
|
| 132 |
+
]
|
| 133 |
+
}
|
| 134 |
+
],
|
| 135 |
"source": [
|
| 136 |
"df.dropna(inplace=True) # remove rows with missing values"
|
| 137 |
]
|
| 138 |
},
|
| 139 |
{
|
| 140 |
"cell_type": "code",
|
| 141 |
+
"execution_count": 7,
|
| 142 |
"id": "ce33dead",
|
| 143 |
"metadata": {},
|
| 144 |
"outputs": [
|
|
|
|
| 150 |
"dtype: bool"
|
| 151 |
]
|
| 152 |
},
|
| 153 |
+
"execution_count": 7,
|
| 154 |
"metadata": {},
|
| 155 |
"output_type": "execute_result"
|
| 156 |
}
|
|
|
|
| 161 |
},
|
| 162 |
{
|
| 163 |
"cell_type": "code",
|
| 164 |
+
"execution_count": 8,
|
| 165 |
"id": "18faac6b",
|
| 166 |
"metadata": {},
|
| 167 |
"outputs": [
|
|
|
|
| 170 |
"output_type": "stream",
|
| 171 |
"text": [
|
| 172 |
"Number\n",
|
| 173 |
+
"1711720458 11\n",
|
| 174 |
+
"1713062177 9\n",
|
| 175 |
+
"1711522945 8\n",
|
| 176 |
+
"1819228188 8\n",
|
| 177 |
+
"1711523859 6\n",
|
| 178 |
+
" ..\n",
|
| 179 |
+
"1708831001 2\n",
|
| 180 |
+
"1939906501 2\n",
|
| 181 |
+
"1713007626 2\n",
|
| 182 |
+
"1711562135 2\n",
|
| 183 |
+
"1911356692 2\n",
|
| 184 |
+
"Name: count, Length: 247, dtype: int64\n"
|
| 185 |
]
|
| 186 |
}
|
| 187 |
],
|
|
|
|
| 193 |
},
|
| 194 |
{
|
| 195 |
"cell_type": "code",
|
| 196 |
+
"execution_count": 9,
|
| 197 |
"id": "32d94a22",
|
| 198 |
"metadata": {},
|
| 199 |
"outputs": [
|
|
|
|
| 202 |
"output_type": "stream",
|
| 203 |
"text": [
|
| 204 |
" Name Number\n",
|
| 205 |
+
"26 MAHABUBA MOSTAFA LCL 1711882510\n",
|
| 206 |
+
"30 MD. ZAHIDUL ISLAM LCL 1611977878\n",
|
| 207 |
+
"40 DIPANKAR BISWAS LCL 1730007780\n",
|
| 208 |
+
"54 SYED MAKHLESUR RAHMAN LCL 1711882510\n",
|
| 209 |
+
"62 SHARMINA FARUQUE LCL 1611977878\n",
|
| 210 |
+
"107 MOHAMMAD SHAHADAT HOSSAIN LCL 1911356692\n",
|
| 211 |
+
"126 FARJANA HAQUE LCL 1711544841\n",
|
| 212 |
+
"127 MOSTOFA AMRANUL HAQUE LCL 1711544841\n",
|
| 213 |
+
"129 RATNA SAHA LCL 1711532555\n",
|
| 214 |
+
"130 SYAMAL KUMAR SAHA LCL 1711532555\n",
|
| 215 |
+
"132 BIPLOP KUMAR SAHA LCL 1971591764\n",
|
| 216 |
+
"133 LIPI SAHA LCL 1971591764\n",
|
| 217 |
+
"141 MD. SHAKAWAT HOSSAIN MAMUN LCL 1711520325\n",
|
| 218 |
+
"144 SHAHEENA SULTANA LCL 1819207048\n",
|
| 219 |
+
"146 KHADIJA BEGUM LCL 1779737102\n",
|
| 220 |
+
"147 TOFAHEL HOSSAIN ROMEL LCL 1779737102\n",
|
| 221 |
+
"148 MADHU SUDAN ROY LCL 1711537157\n",
|
| 222 |
+
"149 JAYA ROY LCL 1711537157\n",
|
| 223 |
+
"166 ABUL MUNIM KHAN LCL 1720285133\n",
|
| 224 |
+
"170 BABUL DAS LCL 1755601445\n",
|
| 225 |
+
"176 MD. RUKUNUZZAMAN LCL 1753896508\n",
|
| 226 |
+
"200 M. ENAMUL HAQ LCL 1819223993\n",
|
| 227 |
+
"211 SHAFIQUL ISLAM LCL 1711547786\n",
|
| 228 |
+
"234 MD. HUMAYUN KABIR KHAN LCL 1726921831\n",
|
| 229 |
+
"239 MD. RAFAYET ULLAH KHAN LCL 1713049928\n",
|
| 230 |
+
"297 M SAJEDUL KARIM LCL 1711532282\n",
|
| 231 |
+
"334 SAGARI DEBI SHINGHA LCL 1730007780\n",
|
| 232 |
+
"337 ZAHEED UDDIN AHMED LCL 1713004343\n",
|
| 233 |
+
"352 F.M. Kabir Mohiuddin 1711563231\n",
|
| 234 |
+
"353 Nazrul Islam Sikder 1713031418\n",
|
| 235 |
+
"354 Nazrul Islam Sikder 1713031418\n",
|
| 236 |
+
"356 Md. Resaul Karim Jahid 1713007626\n",
|
| 237 |
+
"357 Abdullah Hil Nakib 1711529944\n",
|
| 238 |
+
"364 Md. Anwar Hossain Chowdhury 1711520079\n",
|
| 239 |
+
"367 Mohiuddin Ahmed Bhuiyan 1321110410\n",
|
| 240 |
+
"368 M.Tamiz Uddin Bhuiyan 1321110410\n",
|
| 241 |
+
"371 Inamul Haq Khan 1711538761\n",
|
| 242 |
+
"373 Nazrul Islam Mazumder 1711522945\n",
|
| 243 |
+
"374 Md. Ismail Hossain 1711520864\n",
|
| 244 |
+
"378 Kazi Abdus Sobahan 1711267387\n",
|
| 245 |
+
"384 Md. Shahadat Hossain 1911356692\n",
|
| 246 |
+
"388 A.K.M. Alamgir 1819385815\n",
|
| 247 |
+
"389 A.H. Aslam Sunny 1711561419\n",
|
| 248 |
+
"392 Haroon Or Rashid Howlader 1711525656\n",
|
| 249 |
+
"394 Dr. Tariquddin Ahmed 1711640137\n",
|
| 250 |
+
"396 Mohammed Abdus Salam 1711720458\n",
|
| 251 |
+
"398 Wasim Rahman 1729296458\n",
|
| 252 |
+
"405 Engr. Mosharraf Hussain 1713062177\n",
|
| 253 |
+
"406 Kazi Mizanur Rahman 1819284278\n",
|
| 254 |
+
"407 Md. Mazibur Rahman Mazumder 1978062811\n"
|
| 255 |
]
|
| 256 |
}
|
| 257 |
],
|
|
|
|
| 262 |
},
|
| 263 |
{
|
| 264 |
"cell_type": "code",
|
| 265 |
+
"execution_count": 10,
|
| 266 |
"id": "0f5af544",
|
| 267 |
"metadata": {},
|
| 268 |
"outputs": [
|
|
|
|
| 270 |
"name": "stdout",
|
| 271 |
"output_type": "stream",
|
| 272 |
"text": [
|
| 273 |
+
"Before: 2495\n",
|
| 274 |
+
"After : 2119\n",
|
| 275 |
+
"Removed: 376\n"
|
| 276 |
]
|
| 277 |
}
|
| 278 |
],
|
|
|
|
| 288 |
},
|
| 289 |
{
|
| 290 |
"cell_type": "code",
|
| 291 |
+
"execution_count": 11,
|
| 292 |
"id": "6c1e477b",
|
| 293 |
"metadata": {},
|
| 294 |
"outputs": [
|
|
|
|
| 296 |
"name": "stdout",
|
| 297 |
"output_type": "stream",
|
| 298 |
"text": [
|
| 299 |
+
"0 01912101010\n",
|
| 300 |
+
"1 01768384465\n",
|
| 301 |
+
"2 01886964400\n",
|
| 302 |
+
"3 01944730552\n",
|
| 303 |
+
"4 01732201199\n",
|
| 304 |
"Name: Number, dtype: object\n"
|
| 305 |
]
|
| 306 |
}
|
|
|
|
| 317 |
},
|
| 318 |
{
|
| 319 |
"cell_type": "code",
|
| 320 |
+
"execution_count": 12,
|
| 321 |
"id": "a61f5286",
|
| 322 |
"metadata": {},
|
| 323 |
"outputs": [
|
|
|
|
| 325 |
"name": "stdout",
|
| 326 |
"output_type": "stream",
|
| 327 |
"text": [
|
| 328 |
+
"[{'name': 'MD. MAHBUBER RAHMAN CHOWDHURY LCL', 'number': '01912101010'}, {'name': 'MD. MOSTAFIZUR RAHMAN LCL', 'number': '01768384465'}, {'name': 'MOSTAFA FAISAL MAHMUD LCL', 'number': '01886964400'}, {'name': 'DEWAN MD. MOINUL ISLAM MILON LCL', 'number': '01944730552'}, {'name': 'M A BATEN LCL', 'number': '01732201199'}]\n"
|
| 329 |
]
|
| 330 |
}
|
| 331 |
],
|
|
|
|
| 347 |
},
|
| 348 |
{
|
| 349 |
"cell_type": "code",
|
| 350 |
+
"execution_count": 13,
|
| 351 |
"id": "aa5aecb4",
|
| 352 |
"metadata": {},
|
| 353 |
"outputs": [
|
|
|
|
| 355 |
"name": "stdout",
|
| 356 |
"output_type": "stream",
|
| 357 |
"text": [
|
| 358 |
+
"[{'name': 'MD. MAHBUBER RAHMAN CHOWDHURY LCL', 'number': '01912101010'}, {'name': 'MD. MOSTAFIZUR RAHMAN LCL', 'number': '01768384465'}, {'name': 'MOSTAFA FAISAL MAHMUD LCL', 'number': '01886964400'}, {'name': 'DEWAN MD. MOINUL ISLAM MILON LCL', 'number': '01944730552'}, {'name': 'M A BATEN LCL', 'number': '01732201199'}]\n",
|
| 359 |
+
"Total valid numbers: 2096\n"
|
| 360 |
]
|
| 361 |
}
|
| 362 |
],
|
|
|
|
| 378 |
},
|
| 379 |
{
|
| 380 |
"cell_type": "code",
|
| 381 |
+
"execution_count": 14,
|
| 382 |
"id": "4755835a",
|
| 383 |
"metadata": {},
|
| 384 |
"outputs": [
|
|
|
|
| 387 |
"output_type": "stream",
|
| 388 |
"text": [
|
| 389 |
"Duplicate numbers found:\n",
|
| 390 |
+
"{'name': 'SHAHRIAR AHMED', 'number': '01711642203'}\n"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 391 |
]
|
| 392 |
}
|
| 393 |
],
|
|
|
|
| 410 |
},
|
| 411 |
{
|
| 412 |
"cell_type": "code",
|
| 413 |
+
"execution_count": 15,
|
| 414 |
"id": "1c62c0de",
|
| 415 |
"metadata": {},
|
| 416 |
"outputs": [
|
|
|
|
| 419 |
"output_type": "stream",
|
| 420 |
"text": [
|
| 421 |
"After removing duplicates:\n",
|
| 422 |
+
"2095\n"
|
| 423 |
]
|
| 424 |
}
|
| 425 |
],
|
|
|
|
| 439 |
},
|
| 440 |
{
|
| 441 |
"cell_type": "code",
|
| 442 |
+
"execution_count": 16,
|
| 443 |
"id": "78c1adec",
|
| 444 |
"metadata": {},
|
| 445 |
"outputs": [],
|