Skip to content

Maksim Dzhigil#6

Open
maksim-dzhigil wants to merge 4 commits intorailbotan:mainfrom
maksim-dzhigil:main
Open

Maksim Dzhigil#6
maksim-dzhigil wants to merge 4 commits intorailbotan:mainfrom
maksim-dzhigil:main

Conversation

@maksim-dzhigil
Copy link

No description provided.

"equal = \n",
"equal"
"equal = a == b\n",
"equal.all()"
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

"N = (r * c) // 2\n",
"print(N)\n",
"sample = \n",
"sample = np.random.choice(a.ravel(), size=N)\n",
Copy link
Owner

Choose a reason for hiding this comment

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

Лучше использовать flatten вместо ravel, так как ravel сохраняет ссылки на оригинальный массив

@railbotan
Copy link
Owner

5 баллов

"id": "fYkBDZMdutTl"
},
"source": [
"print(f\"Статситика по расе: {data.groupby('age').race.describe()}\")\n",
Copy link
Owner

Choose a reason for hiding this comment

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

Нужно было группировать по расе и полу, а статистику брать по возрасту.

"# наверно, к этому нужно было бы прийти самостоятельно\n",
"# data[\"married\"] = data[\"marital-status\"].apply(lambda row: \"Married\" in row)\n",
"\n",
"all_men = (data[data.sex == 'Male'].married == True).shape[0]\n",
Copy link
Owner

Choose a reason for hiding this comment

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

all_men = data[data.sex == 'Male'].shape[0]

@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