Skip to content

Instantly share code, notes, and snippets.

View ahmedshahriar's full-sized avatar
Working from home

Ahmed Shahriar Sakib ahmedshahriar

Working from home
View GitHub Profile
ahmedshahriar / Top-1000-Celebrity-Twitter-Accounts.csv
Created February 28, 2022 23:52 — forked from mbejda/Top-1000-Celebrity-Twitter-Accounts.csv
Top 1000 Celebrity Twitter Accounts (twitter,domain,name,type)
View Top-1000-Celebrity-Twitter-Accounts.csv
twitter domain name type
katyperry KATY PERRY celebrity
justinbieber Justin Bieber celebrity
taylorswift13 Taylor Swift celebrity
rihanna Rihanna celebrity
ladygaga The Countess celebrity
jtimberlake Justin Timberlake celebrity
TheEllenShow Ellen DeGeneres celebrity
britneyspears Britney Spears celebrity
Cristiano Cristiano Ronaldo celebrity
ahmedshahriar /
Created February 19, 2022 11:47 — forked from miku/
How do you split a csv file into evenly sized chunks in Python?
#!/usr/bin/env python
# import csv
# reader = csv.reader(open('4956984.csv', 'rb'))
def gen_chunks(reader, chunksize=100):
Chunk generator. Take a CSV `reader` and yield
`chunksize` sized slices.
ahmedshahriar / icon-scholar.html
Last active September 21, 2021 16:55 — forked from epignatelli/icon-scholar.html
Fontawesome icon for Google Scholar
View icon-scholar.html
// google-scholar.svg
<svg height="2500" width="2500" xmlns="" viewBox="0 0 512 512">
<g fill="none" fill-rule="evenodd"><path d="M256 411.12L0 202.667 256 0z" fill="#4285f4"/>
<path d="M256 411.12l256-208.453L256 0z" fill="#356ac3"/>
<circle cx="256" cy="362.667" fill="#a0c3ff" r="149.333"/>
<path d="M121.037 298.667c23.968-50.453 75.392-85.334 134.963-85.334s110.995 34.881 134.963 85.334H121.037z" fill="#76a7fa"/>
// style.css
ahmedshahriar /
Created September 7, 2021 14:04
A simple function which takes model and parameter space as input and to tune the hyperparameters of a model using Grid Search or Random Search method selected
from sklearn.model_selection import GridSearchCV, RandomizedSearchCV, StratifiedKFold
from sklearn.metrics import accuracy_score
# configure the cross-validation procedure
kf = StratifiedKFold(n_splits = 10 , shuffle = True , random_state = 42)
def tune_hyperparameter(search_method, estimator, search_space):
# enumerate splits
outer_results = list()
ahmedshahriar /
Created May 7, 2021 17:44
Merge multiple CSV files with identical columns
import pandas as pd
import glob
path = r'C:\DRO\DCL_rawdata_files' # use your path
all_files = glob.glob(path + "/*.csv")
li = []
for filename in all_files:
df = pd.read_csv(filename, index_col=None, header=0) # to keep a single header
ahmedshahriar /
Last active July 9, 2021 00:11
This python script will map a list (length 10 for 10 executor) and execute 10 concurrent processes using concurrent module
import concurrent.futures
def test(li):
# print('hello world')
if li:
print('hello world', li)
def run_all(li):
ahmedshahriar / database.ini
Last active April 12, 2021 09:52
Postgres initialization with Python. contains two script , 1. Postgres db config , 2. db connector
View database.ini
ahmedshahriar /
Created March 9, 2021 22:03
MongoDecimalField to work with mongdb decimal field using djongo
MongoDecimalField to work with mongdb decimal field using djongo
from bson.decimal128 import Decimal128
from djongo.models import DecimalField
View design_resources.txt
Avater pack