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

Showing posts older than #179 · Back to latest

Older Posts 20 shown
Post #178 631
Что выведет код?
import numpy as np
Polynomial = np.polynomial.Polynomial
p = Polynomial([1, -1, 1])
q = Polynomial([2, -3])
print(int((p + q)(1)))
Post #176 495
Что выведет код?
import re
s = "<span>1</span><b>2</b>"
p1 = re.compile(r"(<\w+>.*</\w+>)")
p2 = re.compile(r"(<\w+>.*?</\w+>)")
x1 = p1.findall(s)
x2 = p2.findall(s)
print(len(x1), len(x2))
Post #173 488
Что выведет код?
from itertools import repeat, chain
class A:
def __init__(self, x):
self.x = x
def __reversed__(self):
return chain(reversed(self.x), repeat(0, 2))
a = A([1, 2])
print(*reversed(a))
Post #171 460
Что выведет код?
class X:
def __init__(self, l):
self.l = l
def __iter__(self):
return (x for x in self.l)
a = X([1, 2])
b = X([3, 4])
print(*chain(a, a, b, b))
Post #169 476
Какой из вариантов выведет 4 9 ?
from itertools import islice
g = (i**2 for i in range(1, 4))
print(*g[1:3]) # 1
print(*islice(g, 1, 3)) # 2
print(*slice(g, 1, 3)) # 3
print(*g.slice(1, 3)) # 4
Post #167 398
Что выведет код?
from itertools import zip_longest
print(*[*zip_longest([1], [3, 4])])
Post #162 366
Что выведет код?
import numpy as np
basket = np.array([[1, 1, 1, 1], [1, 1, 1, 0]])
x = np.all(basket[:,2:], axis = 1)
print(*x)
Post #159 461
Что выведет код?
from fractions import Fraction
a = Fraction(2, 3)
b = Fraction(1, 2)
print(a - b)
Post #157 488
Что выведет код?
x= -7 // 3 == -(7 // 3)
y = -7 // -3 == 7 // 3
print(x, y)
Post #155 512
Что выведет код?
from sklearn.cluster import KMeans
import numpy as np
x = np.array([[35, 7000], [45, 6900], [70, 7100], [20, 2000], [25, 2200], [15, 1800]])
kmeans = KMeans(n_clusters=2).fit(x)
y = kmeans.cluster_centers_
print(y)
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 →