-
Notifications
You must be signed in to change notification settings - Fork 15
Maksim Dzhigil #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| "equal = \n", | ||
| "equal" | ||
| "equal = a == b\n", | ||
| "equal.all()" |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Лучше использовать flatten вместо ravel, так как ravel сохраняет ссылки на оригинальный массив
|
5 баллов |
| "id": "fYkBDZMdutTl" | ||
| }, | ||
| "source": [ | ||
| "print(f\"Статситика по расе: {data.groupby('age').race.describe()}\")\n", |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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]
|
5 баллов |
No description provided.