Skip to content

Instantly share code, notes, and snippets.

View ilyasustun's full-sized avatar

Ilyas Ustun ilyasustun

View GitHub Profile
@ilyasustun
ilyasustun / useful_pandas_snippets.py
Created November 29, 2016 05:47 — forked from bsweger/useful_pandas_snippets.md
Useful Pandas Snippets
# List unique values in a DataFrame column
pd.unique(df.column_name.ravel())
# Convert Series datatype to numeric, getting rid of any non-numeric values
df['col'] = df['col'].astype(str).convert_objects(convert_numeric=True)
# Grab DataFrame rows where column has certain values
valuelist = ['value1', 'value2', 'value3']
df = df[df.column.isin(valuelist)]
@ilyasustun
ilyasustun / python_gists.txt
Created March 25, 2018 14:24
python gists
# Do not show warnings
import warnings; warnings.simplefilter('ignore')
# When reading:
with open(fname, 'rb') as file:
response = pickle.load(file)
# When writing:
with open(fname, 'wb') as file:
pickle.dump(response, file)
https://matplotlib.org/users/customizing.html
# matplotlib.rcParams
- dictionary-like
- is global to the matplotlib package
# Modify directly each parameter:
import matplotlib as mpl
mpl.rcParams['lines.linewidth'] = 2
mpl.rcParams['lines.color'] = 'r'
@ilyasustun
ilyasustun / create_directory.py
Created January 3, 2020 18:20
create directory in python
import os
path = 'C:/some_place'
if not os.path.exists(path):
os.makedirs(path)
@ilyasustun
ilyasustun / 1 - Mock Interview: Experimentation.md
Created January 15, 2020 05:06 — forked from alfaraday/1 - Mock Interview: Experimentation.md
Mock interview scripts and rubrics for the Data Science program. These scripts are intended for interviewers only, please do not share this link.

Mock Interview 1: Experimentation

After completing Unit 1, students will take an interview focused on experimentation. The goal of this interview is to evaluate problem solving in the context of experimentation. Students should be able to design a proper A/B test and discuss how they would evaluate it.

We use a generic coffee shop as the setup for this problem. The form of the interview in general is as follows, though be sure to be prepared to adapt to the path the student chooses to pursue.

Afterwards, write up comments and ways to improve and submit them via the Typeform linked in your dashboard.

Introduce yourself first! Ask if they have any questions before you begin, and then start the interview.