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.49K
Photos
30
Videos
1
Links
41

Showing posts older than #1426 · Back to latest

Older Posts 20 shown
Post #1424 3.16K
  • 👨‍💻 3
  • 👍 1
  • 🔥 1
Post #1423 2.97K
Что выведет код?
import numpy as np
a = np.array([[1, 2, 3, 4]])
print(np.percentile(a, 50))
Post #1420 3.22K
Что выведет код?
import numpy as np
x = np.maximum([1, -5, 6], [0, np.nan, -1])
print(*x)
Post #1418 3.22K
Что выведет код?
import numpy as np
x = np.fmax([1, -5, 6], [2, np.nan, -1])
print(*x)
Post #1415 2.91K
Что выведет код?
import numpy as np
x = np.fmin([1, -5, 6], [0, np.nan, -1])
print(*x)
  • 👍 2
Post #1412 2.78K
Что выведет код?
import numpy as np
a = np.array([1, 2, np.nan, np.nan])
print(np.max(a), np.nanmax(a))
Post #1409 2.52K
Что выведет код?
import numpy as np
a = np.array([1, 2, np.nan, np.nan])
print(np.min(a), np.nanmin(a))
Post #1405 2.26K
Что выведет код?
from itertools import repeat, chain
x = [1, 2]
print(*chain(*repeat(x, 2)))
Post #1403 2.26K
Что выведет код?
import heapq
a = [1, 4]
b = [2, 5]
for c in heapq.merge(a, b):
print(c, end='')
Post #1401 2.3K
Что выведет код?
from collections import Iterable
items = [1, [2, 3, [4], 5], 6]
def flatten(items):
for x in items:
if isinstance(x, Iterable):
yield from flatten(x)
else:
yield x

print(*flatten(items))
Post #1399 2.42K
Что выведет код?
class X:
def __init__(self, l):
self.it = (x for x in l)
def __iter__(self):
return self.it
a = X([1, 2])
b = X([3, 4])
print(*chain(a, a, b, b))
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 →