По всем вопросам- @haarrp
@ai_machinelearning_big_data - машинное обучение
@programming_books_it - бесплатные it книги
@pythonl - 🐍
@ArtificialIntelligencedl - AI
@datascienceiot -ds книги
Post #153
559

MA @machinelearningtest
Showing posts older than #154 · Back to latest

import re
s = "a x \n x a"
p1 = re.compile(r"a.*?a")
p2 = re.compile(r"a.*?a", re.DOTALL)
r1 = p1.findall(s)
r2 = p2.findall(s)
print(len(r1), len(r2))
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())

class A:
def __init__(self, x):
self.x = x
def __and__(self, other):
return self.x + other.x
a1 = A(1)
a2 = A(2)
# ваш код(lambda: 1 + lambda: 1 + lambda: 1)()()()
ord('5') - ord('2')
import numpy as np
b = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
print("Полученная матрица:\n", b)
print(np.max(b, axis=0))