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 #958 · Back to latest

Older Posts 20 shown
Post #957 3.49K
Что выведет код?
import numpy as np
a = np.array([[3, 2], [1, -1]])
a.sort()
print(a[-1, 0])
Post #954 3.05K
Что выведет код?
import numpy as np
a = np.array([[1, 2], [3, 4]])
x = a.argmin()
y = a.argmax()
print(a.ravel()[x + y])
  • 👍 1
Post #952 2.98K
Что выведет код?
import numpy as np
a = np.array([[1, 2], [3, 4]])
b = (a.max(axis=1) - a.min(axis=0)).max()
print(b)
Post #950 3K
Что выведет код?
import numpy as np
x = np.linspace(0, 1, 2)
y = np.linspace(0, 1, 3)
X1, Y1 = np.meshgrid(x, y)
X2, Y2 = np.meshgrid(x, y, sparse=True)
print(*X1.shape, *Y1.shape, *X2.shape, *Y2.shape)
Post #948 2.97K
Что выведет код?
import numpy as np
x = np.linspace(0, 2, 3)
y = np.linspace(0, 1, 2)
X, Y = np.meshgrid(x, y)
print(int(X.sum()), int(Y.sum()))
Post #945 3.19K
Что выведет код?
import numpy as np
a = np.arange(4).reshape(2, 2)
b = a[:, np.newaxis, :]
print(b.shape)
Post #943 2.95K
Что выведет код?
import numpy as np
np.newaxis is None
Post #941 2.96K
Что выведет код?
import numpy as np
vals = np.arange(1, 10)
bools = (vals % 2 == 0) | (vals % 3 == 0) & ~(vals % 9 == 0)
print(vals[bools])
Post #939 2.86K
Что выведет код?
import numpy as np
a = np.array([1, 2, 3])
ia = np.array([True >> 0, False, True])
print(a[ia].sum())
Post #938 3.08K
  • 🔥 1
Post #937 2.91K
Что выведет код ?
import numpy as np
a = np.array([3, 1, 2])
ia = np.array([True, False, True])
print(a[ia].sum())
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 →