In [1]:
print("hh")
In [2]:
print("sdfa")
In [3]:
range(10)
Out[3]:
In [4]:
list(range(10))
Out[4]:
In [5]:
list(map(lambda x : x+3 ,(list(range(10)))))
Out[5]:
In [6]:
list(map(lambda x: x+3, range(10)))
Out[6]:
In [7]:
def add(x):
return x+3
list(map(add,range(10)))
Out[7]:
In [8]:
import numpy as np
In [9]:
a = np.zeros([3,2])
print(a)
In [10]:
a[1,0] = 2
In [31]:
a
Out[31]:
In [32]:
print(a)
In [33]:
import matplotlib.pyplot as pl
In [34]:
print("gg")
In [35]:
print("hh")
In [36]:
%matplotlib inline
In [38]:
pl.imshow(a, interpolation="nearest")
Out[38]:
In [39]:
print(a)
In [40]:
a[0,1] = 1
a[0,0] =10
a[2,0] =4
a[2,1] = 8
In [41]:
print(a)
In [42]:
pl.imshow(a, interpolation="nearest")
Out[42]:
In [43]:
pl.imshow(a, interpolation="nearest")
Out[43]:
In [44]:
pl.imshow(a)
Out[44]:
In [45]:
pl.imshow(a, interpolation="nearest")
Out[45]:
In [46]:
import random as rand
In [47]:
arr = list(range(1,10))
In [48]:
print(arr)
In [49]:
print(rand.randrange(1,10))
In [50]:
for i in range(1,10):
print(rand.randrange(1,10))
In [51]:
rand.sample(range(1,10),2)
Out[51]:
In [52]:
k = rand.sample(range(100),10)
In [53]:
print(k)
In [ ]:
In [54]:
[k]
Out[54]:
In [55]:
pl.imshow([k])
Out[55]:
In [56]:
pl.imshow([k],interpolation="nearest")
Out[56]:
In [57]:
tmp = []
for i in range(1000):
tmp.append(rand.sample(range(1000),1000))
pl.imshow(tmp, interpolation="nearest")
Out[57]:
In [58]:
pl.imshow(tmp)
Out[58]:
In [73]:
tmp = []
for i in range(50):
tmp.append(rand.sample(range(100),50))
pl.imshow(tmp, interpolation="nearest")
Out[73]:
In [74]:
pl.imshow(tmp)
Out[74]:
In [75]:
array = rand.sample(range(10),10)
In [76]:
print(array)
In [80]:
class Foo:
def func():
print("A")
def func2(self):
print(id(self))
print("B")
In [81]:
f = Foo()
f.func2()
In [82]:
print(id(f))
In [ ]: