<jupyter_start><jupyter_text>DATA STRUCTURES (VERİ YAPILARI)  Array (dizi) yapisi<jupyter_code>import numpy as np
array=np.array([[1,2,3,4,5]])
print(array)
print(type(array))
print("Boyut :",array.shape)
array2D=np.array([[1,2,3,4,5],
                 [6,7,8,9,10]])
print(array2D)
print(type(array2D))
print("2. Satir 5. Sutun",array2D[1,4])
print("Boyut :",array2D.shape)<jupyter_output>[[ 1  2  3  4  5]
 [ 6  7  8  9 10]]
<class 'numpy.ndarray'>
2. Satir 5. Sutun 10
Boyut : (2, 5)<jupyter_text>Dynamic Array ![image.png](attachment:image.png)<jupyter_code>import ctypes #yeni array yaratmak için kullanilir.

class DynamicArray(object):
    def __init__(self):
        self.n=0       #eleman sayisi
        self.capacity=1 #kapasite
        self.A=self.make_array(self.capacity)
    def __len__(self):
        return self.n
    def __getitem__(self,k):
        if not 0<= k < self.n:
            return IndexError("k is out of bounds !")
        return self.A[k]
    def append(self,eleman):
        if self.n==self.capacity:
            self.resize(2*self.capacity)
        self.A[self.n]=eleman
        self.n+=1
    def resize(self,new_cap):
        B=self.make_array(new_cap)
        
        for k in range(self.n):
            B[k]=self.A[k]
        self.A=B
        self.capacity=new_cap
    def make_array(self,new_cap):
        return (new_cap*ctypes.py_object)() #yeni array
arr=DynamicArray()
arr.append(1)
print(arr[0])
arr.append(3)
print(arr[0],arr[1])
arr.append(5)
print(arr[0],arr[1],arr[2])<jupyter_output>1
1 3
1 3 5<jupyter_text>wordSplit*input=["deeplearning","d,dll,a,dee,base,lear,learning"] *output=["deep, learning"]<jupyter_code>def wordSplit(liste):
    word=list((liste[0]))
    d=liste[1].split(",")
    for i in range(1,len(word)):
        c=word[:]
        c.insert(i," ")
        x , y="".join(c).split()
        if x in d and y in d:
            return x + " , "+ y
    return "bulunamadi..."
print(wordSplit(["deeplearning","d,dll,a,deep,dee,base,lear,learning"]))<jupyter_output>deep , learning
{'fraction_non_alphanumeric': 0.16805896805896806, 'fraction_numerical': 0.03194103194103194, 'mean_word_length': 3.3044397463002113, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '432773', 'license': 'MIT', 'n_tokens_mistral': 838, 'n_tokens_neox': 813, 'n_words': 145, 'path': 'DATA STRUCTURES (arrays).ipynb', 'repo_name': 'mkaraca25/Algoritmalar_Veri_Yapilar_v_Real_Life_Python_Problemleri', 'size': '2035'}