Vetor para linha, para vetor coluna
>>> a[None].T
array([[1],
[2],
[3]])
>>> np.newaxis is None
True
>>> a.reshape(a.shape+(1,))
array([[1],
[2],
[3]])
>>> a[:,None]
array([[1],
[2],
[3]])
apenas algumas anotações...
>>> a[None].T
array([[1],
[2],
[3]])
>>> np.newaxis is None
True
>>> a.reshape(a.shape+(1,))
array([[1],
[2],
[3]])
>>> a[:,None]
array([[1],
[2],
[3]])
00 13 1,7,14,21,28 * * /home/user/PageDiff.sh diff
#!/bin/sh # Copyright 2009 Ruben Berenguel # ruben /at/ maia /dot/ ub /dot/ es # PageDiffs: Fill in an array of webpages, with the option "write" # will download them, with the "diff" option will re-download them and # check the new against the old for differences. With the "diff mail" # option, will send an email to $MAILRECIPIENT, assuming mail works. # You can find the most up to date version of this file (and the GPL) # http://rberenguel.googlecode.com/svn/trunk/Bash/PageDiffs.sh # 20091226@00:24 MAILRECIPIENT="mail@mail.com" j=0 Pages[j++]="http://www.maia.ub.es/~ruben/" Pages[j++]="http://www.google.es" #Add more pages as above if [ "$1" = "write" ]; then echo Generate files count=0 for i in "${Pages[@]}" do echo Getting "$i" into File$count wget "$i" -v -O "File$count" let count=$count+1 done fi if [ "$1" = "diff" ]; then count=0 for i in "${Pages[@]}" do # echo Getting "$i" into Test$count wget "$i" -q -O "Test$count" Output=$(diff -q "Test$count" "File$count" | grep differ) Result=$? if [ "$Result" = "0" ]; then if [ "$2" = "mail" ]; then echo Page at "$i" has changed since last check! >> MailCont mail=1 fi echo Page at "$i" has changed since last check! else echo Page at "$i" has not changed since last check! fi #rm Test$count let count=$count+1 done if [ "$mail" = "1" ]; then mail -s "Page changed alert!" $MAILRECIPIENT
auto eth0
iface eth0 inet static
address 192.168.10.5
netmask 255.255.255.0
network 192.168.10.0
broadcast 192.168.10.255
gateway 192.168.10.1