TGViewer
Channel Public Channel
Machinelearning tests

Machinelearning tests

@machinelearningtest

По всем вопросам- @haarrp

@ai_machinelearning_big_data - машинное обучение

@programming_books_it - бесплатные it книги

@pythonl - 🐍

@ArtificialIntelligencedl - AI

@datascienceiot -ds книги
Subscribers
661
Photos
35
Videos
0
Links
0
Recent Posts 20 shown
Post #201 412
Что выведет следующий код на Python (модуль statistics)?


import statistics as stats
import math

data = [1, 2, 2, float('nan'), 3, 4]

print("Mean:", stats.mean(data))
print("Median:", stats.median(data))
print("Mode:", stats.mode(data))


🔢 Варианты ответа:

A)

Median: 2.5
Mode: 2


B)

Median: 2.5
Mode: 2


C)ValueError: nan is not a valid number


D)

Median: nan
Mode: 2


Правильный ответ: C

💡 Почему?
- Модуль
statistics не умеет работать с NaN.
-
stats.mean() и stats.median() вызовут StatisticsError или ValueError.
- В отличие от
numpy.nanmean, здесь всё падает.
📌 Подвох — в
float('nan') в списке.
Post #199 608
Что выведет код?
((lambda x: (lambda y:  x ** y)) (3)) (2)
Post #197 471
Что выведет код?
import sys
f = lambda x: list(map(sys.stdout.write, x))
t = f(['1', '2', '3'])
Post #195 1.9K
Что выведет код?
def f(a: int = '1', b: int = '2', c: int = '3') -> int:
return a + b + c
print(f())



@Machinelearningtest - Тесты по машинному обучению и Python
Post #192 397
Что выведет код?
def f(arr):
return arr[0] if len(arr) == 1 else arr[0] + f(arr[1:])
print(f(('a', 'b', 'c', 'd')))
Post #189 655
Дан код и вывод
class A:
def __init__(self, x):
self.x = x
def __call__(self):
return self.x
class B:
def __init__(self, x):
self.x = x
def method(self):
return self.x
class C:
def __init__(self, x=3):
self.x = x
def __repr__(self):
return str(self.x)

a = A(1)
b = B(2)
c = C(3)
callables = # ваш код
print([act() for act in callables])

#Вывод: [1, 2, 3]
Post #186 554
Что выведет код?
class A:
def __init__(self, value):
self.value = value
def __call__(self, other):
return self.value ** other
x = A(2)
print(x(3))
Post #184 753
Что выведет код?
a = [1, 2, 3, 3]
b = {1, 2, 3, 3}
print(set(a) == b, list(b) == a)
Post #182 1.04K
Что выведет код?
import numpy as np
x = np.array([1, 2, 3, 4])
print(np.average(x, weights=[2, 1, 0, 5]))
Post #180 945
Что выведет код?
import numpy as np
data = np.array([2, 7, 3, 1])
bins = [0, 5, 10]
hist, _ = np.histogram(data, bins)
print(*hist)
#data - набор данных
#bins - набор интервалов, задаваемых граничными значениями
Older posts →

About this channel

How can I read @machinelearningtest without a Telegram account?
TGViewer shows the public web preview Telegram publishes for Machinelearning tests: recent posts, photos, videos and the subscriber count, with no app, login or account.
How many subscribers does Machinelearning tests have?
Machinelearning tests (@machinelearningtest) has 661 subscribers on Telegram, refreshed roughly every 30 minutes.
Does Machinelearning tests know I viewed it here?
No. Public channel previews carry no viewer identity, and TGViewer has no accounts or tracking of what you look up.
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →