öncelikle resmin bulunduğu klosör tanımlanmalıdır:
import os
cwd = os.getcwd()
os.chdir("C:\\Users\BM\Desktop")
daha sonra nd array yapısı kullanılarak resim tanımlanır ve 255 ten çıkarılarak inverse edilmiş olur:
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
img = mpimg.imread('img.jpg')
%matplotlib inline
plt.subplot(1,2,1)
plt.imshow(img)
plt.subplot(1,2,2)
plt.imshow(255-img)
hash yapısı ve tanımlaması
my_hash = {}
my_hash[0] = 1
my_hash[1] = 11
my_hash[2] = 55
my_hash[3] = 155
my_hash[4] = 355
for i in my_hash.keys():
print(i)
my_hash[2]+=5
my_hash[2]
