TGViewer
Channel Public Channel
Python Tasks & ML | Задачи по питону и машинному обучению

Python Tasks & ML | Задачи по питону и машинному обучению

@python_tasks

Algorithms, functions, classes, regular expressions, iterators, generators, OOP, exceptions, NumPy, pandas, scikit-learn
https://telega.in/c/python_tasks

Questions — @dina_ladnyuk
Subscribers
8.51K
Photos
30
Videos
1
Links
41

Showing posts older than #2682 · Back to latest

Older Posts 20 shown
Post #2680 806
Что выведет код?
def f(): return 2, 1
b, a = f()
print(a, b)
Post #2678 891
Что выведет код?
def f(x: int) -> float:
pass
a = f.__annotations__
x = a["x"] is int
y = a["return"] is float
print(x, y)
Post #2674 780
Что выведет код?
import numpy as np
Polynomial = np.polynomial.Polynomial
p = Polynomial([1, -1])
q = Polynomial([1, 1])
print(int((p * q)(2)))
Post #2672 796
Что выведет код?
import numpy as np
Polynomial = np.polynomial.Polynomial
p = Polynomial([1, -1, 1])
q = Polynomial([2, -3])
print(int((p + q)(1)))
Post #2670 872
Что выведет код?
import numpy as np
Polynomial = np.polynomial.Polynomial
p = Polynomial([6, -3, 1])
print(int(p(0)), int(p(1)), int(p(2)))
Post #2668 923
Что выведет код?
import numpy as np
data = np.array([2, 7, 3, 1])
bins = [0, 5, 10]
hist, _ = np.histogram(data, bins)
print(*hist)
#data - набор данных
#bins - набор интервалов, задаваемых граничными значениями
Post #2665 845
Что выведет код?
import numpy as np
x = np.array([1., 2., np.nan])
print(np.nanstd(x))
Post #2663 772
Что выведет код?
a = [1, 5, 2, 1, 1, 5]

def f(items):
s = set()
for item in items:
if item not in s:
yield item
s.add(item)
print(*f(a))
Older posts →
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 →