Executing this on ipython forces ipython to reload functions each time it executes them, really usefull if you are testing and modifying at the same time!
%load_ext autoreload
%autoreload 2
Just an extension of my memory - a way to remember all these little tricks I end up forgetting after a while.. Seen a few people use a blog for this.. seems useful
%load_ext autoreload
%autoreload 2
DeprecationWarning
no
longer displays. This has been de-activated by default, however, it can be switched back on
by, for example, doing the following in iPython
>>> import warnings
>>> warnings.simplefilter("always")
iPython
will
display the full DeprecationWarning
mkdir project_documentation_online_build
cd project_documentation_online_build
git init
touch README
git add README
git commit -m'first commit'
git remote add origin git@github.com:YourUserName/project_documentation_online_build.git
git push -u origin master
git symbolic-ref HEAD refs/heads/gh-pages
git checkout gh-pages
git add .
git commit -a -m "First pages commit"
git push origin gh-pages
n_samples = 100
n_features = 1000
import numpy as np
import matplotlib.pyplot as plt
X1 = np.asarray(np.randn(n_samples/2, n_features))
X2 = np.asarray(np.randn(n_samples/2, n_features)) + 5
X = np.append(X1, X2, axis=0)
rnd.shuffle(X)
plt.scatter(X[:,0], X[:,1])
plt.show()
coef = (np.zeros(n_features))
coef[:10] = 1
y = np.sign(np.dot(X,coef))
from sklearn.feature_selection import f_classif
p,v = f_classif(X,y)
plt.plot(p)
plt.show()
layout.html
file for Python's Sphinx and found the following random tit-bit of use when using Jinga:
{%- for rellink in rellinks[1:]|reverse %}
<div class="{{ loop.cycle('buttonPrevious', 'buttonNext') }}">
<a href="{{ pathto(rellink[0]) }}">
{{loop.cycle('Previous', 'Next')}}
</a>
{%- endfor %}
loop.cycle
you can cycle through string
s or div
sdiv
is created first for buttonPrevious and then stash
.
git stash save
git stash apply
git stash clear
git-stashing
, check out %doctest_mode
>>> import numpy as np
>>> some_value = 35
>>> np.sqrt(some_value)
>>>
This method involves forcing iwlagn to not use n, the commands will disable n on the device without making it a permanant change, check first if this work for you, if you notice that the speed improved then continue to make the change permanant. If this solution didn`t work for you, then reboot your computer to revert the chnages.Important: The above method has been quoted from www.unixmen.com, a site that I've found very useful in the past. The method was the one that worked for me and hence why I want it here. To see the full original post that containts two other methods, please go to the Unixmen post that I am quoting from
sudo rmmod -f iwlagn
sudo modprobe iwlagn 11n_disable=1
If you notice that the wifi speed improved, then make the change permanent :
gksudo gedit /etc/modprobe.d/iwlagn-disable11n.conf
and add this line to the file:
options iwlagn 11n_disable=1
save & quit
fig = pl.figure(1, figsize=(4, 3))
pl.clf()
ax = Axes3D(fig, elev=43.5, azim=-110)
....
....
ax.set_xlabel('X_1')
ax.set_ylabel('X_2')
ax.set_zlabel('Y')
ax.w_xaxis.set_ticklabels([])
ax.w_yaxis.set_ticklabels([])
ax.w_zaxis.set_ticklabels([])
An example plot: