I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""making a dataframe""" | |
df = pd.DataFrame([[1, 2], [3, 4]], columns=list('AB')) | |
"""quick way to create an interesting data frame to try things out""" | |
df = pd.DataFrame(np.random.randn(5, 4), columns=['a', 'b', 'c', 'd']) | |
"""convert a dictionary into a DataFrame""" | |
"""make the keys into columns""" | |
df = pd.DataFrame(dic, index=[0]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# adding and committing | |
git add -A # stages All | |
git add . # stages new and modified, without deleted | |
git add -u # stages modified and deleted, without new | |
git commit --amend # Add staged changes to previous commit. Do not use if commit has been pushed. | |
git commit --amend --no-edit # Do so without having to edit the commit message. | |
# remotes - pushing, pulling, and tracking | |
git fetch # gets remote objects and refs. Needed if new branches were added on the remote. | |
git remote -v # Lists all remotes (verbose) |
having a web server turned on doesn't necessarily mean you are serving pages on the world wide web. its what allows you to load your own static files (.html
, .js
etc.) in a browser via http://
.
if you're not sure whether or not you have a web server running, no problem! its easy to confirm.
what happens when you visit http://localhost/?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Working example for my blog post at: | |
# https://danijar.github.io/structuring-your-tensorflow-models | |
import functools | |
import tensorflow as tf | |
from tensorflow.examples.tutorials.mnist import input_data | |
def doublewrap(function): | |
""" | |
A decorator decorator, allowing to use the decorator to be used without |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import absolute_import | |
from __future__ import division | |
from __future__ import print_function | |
import csv | |
import errno | |
import os | |
import re |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import tensorflow as tf | |
from tensorflow.python.layers import core as layers_core | |
hparams = tf.contrib.training.HParams( | |
batch_size=3, | |
encoder_length=4, | |
decoder_length=5, | |
num_units=6, | |
src_vocab_size=7, |