Skip to content

ДЗ Numpy#11

Open
ooonush wants to merge 6 commits intorailbotan:mainfrom
ooonush:main
Open

ДЗ Numpy#11
ooonush wants to merge 6 commits intorailbotan:mainfrom
ooonush:main

Conversation

@ooonush
Copy link

@ooonush ooonush commented Mar 5, 2022

No description provided.

"source": [
"mask = np.random.uniform(2, -12, (5, 5)) \n",
"matrix = np.copy(mask)\n",
"for i in range(5):\n",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вместо цикла np.tria

"mask = np.random.normal(10, 2, 25).reshape(5, 5)\n",
"matrix = np.copy(mask)\n",
"\n",
"for i in range(5):\n",
Copy link
Owner

@railbotan railbotan Mar 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

np.fill_diagonal

"b = np.random.randint(0,2,5)\n",
"print(b)\n",
"equal = \n",
"equal = sum(a == b) == len(a)\n",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

np.array_equal

],
"source": [
"a = np.array([1, np.NaN, np.Inf], float)\n",
"for i, e in enumerate(a):\n",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Булевая индексация
a[np.isnan(a) | np.isinf(a)] = 0

@railbotan
Copy link
Owner

5 баллов

@railbotan
Copy link
Owner

5 баллов

@railbotan
Copy link
Owner

5 баллов

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants