4-Amaliy ishi Bajardi: Turdaliyev e tekshirdi: Karimberdiyev J


Download 21.6 Kb.
Sana02.06.2024
Hajmi21.6 Kb.
#1835327
Bog'liq
4-amaliy


Muhammad al-Xorazmiy nomidagi Toshkent axborot texnologiyalari universiteti Kompyuter injiniring fakulteti 210-20 guruh fakulteti talabasi Elomon Turdaliyev Ma’lumotlarning intellectual tahlili fanidan bajargan
4-Amaliy ishi


Bajardi: Turdaliyev E
Tekshirdi: Karimberdiyev J

function generateRandomArray(n) {


if (n < 2) {
console.log("Arrayda kamida ikkita element bo'lishi kerak.");
return [];
}

let arr = [];

for (let i = 0; i < n; i++) {
arr.push(Math.floor(Math.random() * 100)); // Misol uchun, 0 dan 99 gacha random qiymatlar
}

return arr;


}

function findLargerElements(arr) {


if (arr.length < 2) {
console.log("Arrayda kamida ikkita element bo'lishi kerak.");
return;
}

let result = [];

for (let i = 0; i < arr.length - 1; i++) {
if (arr[i] < arr[i + 1]) {
result.push(arr[i + 1]);
}
}

console.log("Elementlari o'ng qo'shnidan katta bo'lganlar: " + result);


}

// Test qilish


const n = 8; // O'z ishlaganizdagi n soni
const myArray = generateRandomArray(n);
console.log("Random array: " + myArray);
findLargerElements(myArray);



df.drop(["region"], axis=1, inplace=True)
df.shape
(1338, 6)
df[['sex', 'smoker']] = df[['sex', 'smoker']].apply(LabelEncoder().fit_transform)




https://colab.research.google.com/drive/1sTPAeg1_gUoH3J-f8FPA2kwKBjawm6f5?usp=sharing
Download 21.6 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling