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

Older Posts 20 shown
Post #2600 863
Что выведет код?
import numpy as np
a = np.array([0.1, 0.25])
b = np.array([0.1, 0.26])
c = np.allclose(a, b, atol=1e-1)
print(c)
  • 👏 1
Post #2598 969
Что выведет код?
import numpy as np
a = np.array([0.1, 0.25])
b = np.array([0.3, 0.26])
c = np.isclose(a, b, atol=1e-1)
print(*c)
  • 🔥 1
Post #2596 909
Что выведет код?
import numpy as np
a = np.array([1, 1j])
x = np.isreal(a)
y = np.iscomplex(a)
z = x.sum() + y.sum()
print(z)
Post #2594 929
Что выведет код?
import numpy as np
a = np.array([True, False])
print(np.all(a), np.any(a))
Post #2592 965
Дан код
import numpy as np
r = np.array([3, 4, 5])
  • 👍 1
Post #2590 958
Дан код
import numpy as np
a = np.array([[0], [1]])
b = np.array([[1], [-1]])
Post #2588 1K
Дан код
import numpy as np
a = np.array([[0], [1]])
b = np.array([[1], [-1]])
  • 🔥 1
Post #2585 931
Что выведет код?
import numpy as np
a = [('x', 6.0, 1), ('y', 5.0, 2), ('z', 5.0, 3)]
dtype = [('val', 'S1'), ('float', 'f8'), ('int', 'i4')]
b = np.array(a, dtype=dtype)
b.sort(order=['float', 'int'])
print(b[1][0].decode())
Post #2583 965
Что выведет код?
import numpy as np
dt = np.dtype([('x', 'f8')])
a = np.zeros(4, dtype=dt)
a['x'] = np.array((0., 1., 2., 3.))
print(a['x'][2] + a['x'][3])
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 →