Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Ahmed Shahriar Sakib ahmedshahriar

🏠
Working from home
View GitHub Profile
@ahmedshahriar
ahmedshahriar / Top-1000-Celebrity-Twitter-Accounts.csv
Created Feb 28, 2022 — 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 katyperry.com KATY PERRY celebrity
justinbieber smarturl.it Justin Bieber celebrity
taylorswift13 grmypro.co Taylor Swift celebrity
rihanna rihannanow.com Rihanna celebrity
ladygaga The Countess celebrity
jtimberlake justintimberlake.com Justin Timberlake celebrity
TheEllenShow ellentube.com Ellen DeGeneres celebrity
britneyspears britney.lk Britney Spears celebrity
Cristiano Cristiano Ronaldo celebrity
@ahmedshahriar
ahmedshahriar / 4956984.py
Created Feb 19, 2022 — forked from miku/4956984.py
How do you split a csv file into evenly sized chunks in Python?
View 4956984.py
#!/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
ahmedshahriar / icon-scholar.html
Last active Sep 21, 2021 — forked from epignatelli/icon-scholar.html
Fontawesome icon for Google Scholar
View icon-scholar.html
// google-scholar.svg
<svg height="2500" width="2500" xmlns="http://www.w3.org/2000/svg" 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"/>
</g>
</svg>
// style.css
@ahmedshahriar
ahmedshahriar / hyperparameter_tuning_gridsearchCV_randomsearchCV.py
Created Sep 7, 2021
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
View hyperparameter_tuning_gridsearchCV_randomsearchCV.py
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
ahmedshahriar / merge_csv_identical_cols.py
Created May 7, 2021
Merge multiple CSV files with identical columns
View merge_csv_identical_cols.py
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
View free-database-hosting.md
@ahmedshahriar
ahmedshahriar / concurrent_test.py
Last active Jul 9, 2021
This python script will map a list (length 10 for 10 executor) and execute 10 concurrent processes using concurrent module
View concurrent_test.py
import concurrent.futures
def test(li):
# print('hello world')
if li:
print('hello world', li)
def run_all(li):
@ahmedshahriar
ahmedshahriar / database.ini
Last active Apr 12, 2021
Postgres initialization with Python. contains two script , 1. Postgres db config , 2. db connector
View database.ini
[postgresql]
host=localhost
database=my_db
user=postgres
password=postgres
@ahmedshahriar
ahmedshahriar / mongodecimal_field.py
Created Mar 9, 2021
MongoDecimalField to work with mongdb decimal field using djongo
View mongodecimal_field.py
"""
MongoDecimalField to work with mongdb decimal field using djongo
"""
from bson.decimal128 import Decimal128
from djongo.models import DecimalField
# https://github.com/nesdis/djongo/issues/82
# https://github.com/nesdis/djongo/issues/378
View design_resources.txt
Icons
Avater pack
1. https://www.flaticon.com/packs/avatars-93