Skip to content

Instantly share code, notes, and snippets.

🎲
Rolling dice

Shayan Amani SHi-ON

🎲
Rolling dice
Block or report user

Report or block SHi-ON

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@SHi-ON
SHi-ON / regex_numbers_formatted.md
Last active May 30, 2019
specific-length formatted numbers
View regex_numbers_formatted.md

(?<!\d)([0-9]{5}-[0-9]{4}-[0-9]{2})(?!\d)

Explained:

  • ?> lookbehind
  • ?<! negative lookbehind
  • \d digit only
  • ? lookahead
  • ?! negative lookahead
  • [0-9]{5}-[0-9]{4}-[0-9]{2} a specific pattern #####-####-##
@SHi-ON
SHi-ON / us_state_abbreviations.py
Last active May 21, 2019 — forked from JeffPaine/us_state_abbreviations.py
A python list of all US states abbreviations. Alphabetically sorted!
View us_state_abbreviations.py
# alphabetically sorted
# 50 states + D.C = 51
STATES = ["AK", "AL", "AR", "AZ", "CA", "CO", "CT", "DC", "DE", "FL",
"GA", "HI", "IA", "ID", "IL", "IN", "KS", "KY", "LA", "MA",
"MD", "ME", "MI", "MN", "MO", "MS", "MT", "NC", "ND", "NE",
"NH", "NJ", "NM", "NV", "NY", "OH", "OK", "OR", "PA", "RI",
"SC", "SD", "TN", "TX", "UT", "VA", "VT", "WA", "WI", "WV",
"WY"]
@SHi-ON
SHi-ON / stratify_experiment.py
Created Mar 10, 2019
An expirement to show how stratify option works
View stratify_experiment.py
# Experiment to confirm the effect of stratify option in Scikit Learn, tran_test_split() method.
# by Shayan Amani
from sklearn.model_selection import train_test_split
import pandas as pd
raw_data = pd.read_csv("codebase/adrel/dataset/train.csv")
cnt = raw_data.groupby('label').count()
''' experiment begins '''
You can’t perform that action at this time.