mirror of
https://github.com/donnemartin/data-science-ipython-notebooks.git
synced 2024-03-22 13:30:56 +08:00
Merge branch 'master' of https://github.com/donnemartin/data-science-ipython-notebooks
* 'master' of https://github.com/donnemartin/data-science-ipython-notebooks: Added git commands to revert a commit and to undo a push, leaving the local repo intact. Tweaked descrtiption for git add -u. Removed file with incomplete commands, used as my scratch pad. Added common git stash commands. Added snippet to style an IPython Notebook based on a CSS file. Added references to Pyramid, Flask, and Bottle. Added __init__.py Fixed capitalization issue.
This commit is contained in:
commit
a9f8646e5c
|
@ -249,7 +249,7 @@ Notebooks tested with Python 2.7.x.
|
|||
* [PyCon 2015 Scikit-learn Tutorial](https://github.com/jakevdp/sklearn_pycon2015) by Jake VanderPlas
|
||||
* [Parallel Machine Learning with scikit-learn and IPython](https://github.com/ogrisel/parallel_ml_tutorial) by Olivier Grisel
|
||||
* [Statistical Interference Using Computational Methods in Python](https://github.com/AllenDowney/CompStats) by Allen Downey
|
||||
* [Yhat blog](http://blog.yhathq.com/) by Yhat
|
||||
* [Yhat Blog](http://blog.yhathq.com/) by Yhat
|
||||
* [Kaggle](https://www.kaggle.com/) by Kaggle
|
||||
* [Spark Docs](https://spark.apache.org/docs/latest/) by Apache Spark
|
||||
* [AWS Docs](http://aws.amazon.com/documentation/) by Amazon Web Services
|
||||
|
|
0
analyses/__init__.py
Normal file
0
analyses/__init__.py
Normal file
|
@ -155,6 +155,29 @@
|
|||
"| object? | Object details, also use object?? |"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Apply css styling based on a css file:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": true
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from IPython.core.display import HTML\n",
|
||||
"\n",
|
||||
"def css_styling():\n",
|
||||
" styles = open(\"styles/custom.css\", \"r\").read()\n",
|
||||
" return HTML(styles)\n",
|
||||
"css_styling()"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
|
@ -191,7 +214,9 @@
|
|||
"!git reset [target file or commit]\n",
|
||||
"!git reset --hard origin/master\n",
|
||||
"\n",
|
||||
"# Automatically stage tracked files, including deleting the previously tracked files\n",
|
||||
"# Automatically stage tracked files, \n",
|
||||
"# including deleting the previously tracked files\n",
|
||||
"# Does not add untracked files\n",
|
||||
"!git add -u\n",
|
||||
"\n",
|
||||
"# Delete files and stage them\n",
|
||||
|
@ -221,6 +246,12 @@
|
|||
"# Undo a file that has not been added\n",
|
||||
"!git checkout — [target]\n",
|
||||
"\n",
|
||||
"# Revert a commit\n",
|
||||
"!git revert\n",
|
||||
"\n",
|
||||
"# Undo a push and leave local repo intact\n",
|
||||
"!git push -f origin HEAD^:master\n",
|
||||
"\n",
|
||||
"# Undo commit but leave files and index\n",
|
||||
"!git reset --soft HEAD~1\n",
|
||||
"\n",
|
||||
|
@ -228,6 +259,20 @@
|
|||
"!git commit --amend\n",
|
||||
"!git push --force [branch]\n",
|
||||
"\n",
|
||||
"# Take the dirty state of your working directory\n",
|
||||
"# and save it on a stack of unfinished changes\n",
|
||||
"!git stash\n",
|
||||
"\n",
|
||||
"# Get list of stashes\n",
|
||||
"!git stash list\n",
|
||||
"\n",
|
||||
"# Apply the top stash, re-modifying the \n",
|
||||
"# uncommitted files when the stash was saved\n",
|
||||
"!git stash apply\n",
|
||||
"\n",
|
||||
"# Apply a stash at the specified index\n",
|
||||
"!git stash apply stash@{1}\n",
|
||||
"\n",
|
||||
"# Create a branch\n",
|
||||
"!git branch [branch]\n",
|
||||
"\n",
|
||||
|
@ -408,7 +453,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"[Django](https://www.djangoproject.com) is a high-level Python Web framework that encourages rapid development and clean, pragmatic design. Django can be useful to share data reports and analyses on the web. There are Django apps such as [Mezzanine](http://mezzanine.jupo.org) that open up Django to data content management and blogging."
|
||||
"[Django](https://www.djangoproject.com) is a high-level Python Web framework that encourages rapid development and clean, pragmatic design. It can be useful to share reports/analyses and for blogging. Lighter-weight alternatives include [Pyramid](https://github.com/Pylons/pyramid), [Flask](https://github.com/mitsuhiko/flask), [Tornado](https://github.com/tornadoweb/tornado), and [Bottle](https://github.com/bottlepy/bottle)."
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
60
commands/styles/custom.css
Normal file
60
commands/styles/custom.css
Normal file
|
@ -0,0 +1,60 @@
|
|||
<style>
|
||||
@font-face {
|
||||
font-family: "Computer Modern";
|
||||
src: url('http://mirrors.ctan.org/fonts/cm-unicode/fonts/otf/cmunss.otf');
|
||||
}
|
||||
div.cell{
|
||||
width:800px;
|
||||
margin-left:16% !important;
|
||||
margin-right:auto;
|
||||
}
|
||||
h1 {
|
||||
font-family: Helvetica, serif;
|
||||
}
|
||||
h4{
|
||||
margin-top:12px;
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
div.text_cell_render{
|
||||
font-family: Computer Modern, "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;
|
||||
line-height: 145%;
|
||||
font-size: 130%;
|
||||
width:800px;
|
||||
margin-left:auto;
|
||||
margin-right:auto;
|
||||
}
|
||||
.CodeMirror{
|
||||
font-family: "Source Code Pro", source-code-pro,Consolas, monospace;
|
||||
}
|
||||
.prompt{
|
||||
display: None;
|
||||
}
|
||||
.text_cell_render h5 {
|
||||
font-weight: 300;
|
||||
font-size: 22pt;
|
||||
color: #4057A1;
|
||||
font-style: italic;
|
||||
margin-bottom: .5em;
|
||||
margin-top: 0.5em;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.warning{
|
||||
color: rgb( 240, 20, 20 )
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
MathJax.Hub.Config({
|
||||
TeX: {
|
||||
extensions: ["AMSmath.js"]
|
||||
},
|
||||
tex2jax: {
|
||||
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
|
||||
displayMath: [ ['$$','$$'], ["\\[","\\]"] ]
|
||||
},
|
||||
displayAlign: 'center', // Change this to 'center' to center equations.
|
||||
"HTML-CSS": {
|
||||
styles: {'.MathJax_Display': {"margin": 4}}
|
||||
}
|
||||
});
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user