Python関連記事インデックス(8)
x = x+1 if x%2==1 else x
from t1 import Cal
:from import
c=Cal()
b=c.cha(1,2)
print(b)
3. [python2.X ](http://blog.csdn.net/leos_blog/article/details/17529621)
> print , 。
4. [bool ](http://bbs.chinaunix.net/thread-4135006-1-1.html)
>```
>>> a = True
>>> print not a
False
>>>
- Python 2.7: How to check if a deque is empty?
If d is your deque, use
if d:
# not empty
else:
# empty
6. [Python Queue ](http://www.jb51.net/article/58004.htm)
7. [python ](https://zhidao.baidu.com/question/2205395452338413588.html)
>```
variables={}
for i in range(1,band):
variables['a'+str(i)]=ds.GetRasterBand(i).ReadAsArray(0,0,cols,rows)
python
?
, , 。 , , g_nvalue 。 g_nvalue , , ! , !
, , , , 。
- python
global a
a = 3
def Fuc():
global a
print a
a = a + 1
if name == "main":
global a
for i in range(10):
Fuc()print 'hello'
print a
** , ; , Fuc(a) 。**
11. [python pass ](https://zhidao.baidu.com/question/1304206824698910299.html)
12. [Python ](http://blog.sina.com.cn/s/blog_6163bdeb01018044.html)
##
1. [python ](http://www.cnblogs.com/dkblog/archive/2011/03/14/1983250.html)
> :
` 。
` 。
` 。
` 。
2. [Python Pool ](http://blog.csdn.net/bravezhe/article/details/7298051)
>pool.apply_async()
3. [Python 11 (multiprocessing )](http://www.cnblogs.com/vamei/archive/2012/10/13/2722254.html)
>```
num = multiprocessing.Value('d', 0.0)
arr = multiprocessing.Array('i', range(10))
, Value Array 。 Value (d), 0.0。 Array C , (i, )。 Process , Value Array 。 , , , 。
NumPy
- NumPy ( 、 3)
column_stack((oned, twiceoned))
array([[0, 2],
[1, 3]])
2. [numpy ](http://www.cnblogs.com/plwang1990/p/3842073.html)
>** 10, **
mu,sigma=0,0.1 #
rarray=numpy.random.normal(mu,sigma,10)
3. [numpy.std() ](http://blog.csdn.net/chixujohnny/article/details/51106481)
4. [python :[13] ](http://jingyan.baidu.com/article/a378c9609b5849b328283093.html)
> **numpy.corrcoef** , , t t s s
5. [numpy mean() ](http://blog.csdn.net/zhouzhousofer/article/details/51166799)
> 。
6. [Python NumPy ](http://www.jb51.net/article/66236.htm)
>hstack((a, b)) # a b
##Matplotlib
1. [Python matplotlib fill_betweenx](http://blog.csdn.net/yangyangyang20092010/article/details/49951181)
2. [ :python plt.hist ](http://www.cnblogs.com/python-life/articles/6084059.html)
>```
x : (n,) array or sequence of (n,) arrays
bin( ) , x
bins : integer or array_like, optional
bin( ) ,
normed : boolean, optional
If True, the first element of the return tuple will be the counts normalized to form a probability density, i.e.,n/(len(x)`dbin)
, , 1
color : color or array_like of colors or None, optional
- Python :matplotlib
& Line and scatter plots
Debug
- AttributeError: 'module' object has no attribute 'dumps'
- python 3.5 map
python 3 python2 map
print( list(map(lambda..., ...) ))
list() map