-
Notifications
You must be signed in to change notification settings - Fork 15
Koltunov Matvey #7
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
| "indexes = np.argmax(matrix, axis=1)\n", | ||
| "print(indexes)\n", | ||
| "print(...)" | ||
| "print([matrix[i, j] for i, j in enumerate(indexes)])" |
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.max(matrix, axis=1)
|
5 баллов |
| "id": "rK9SwvI_utTj" | ||
| }, | ||
| "source": [ | ||
| "**6. Правда ли, что люди, которые получают больше 50k, имеют как минимум высшее образование? (признак *education – Bachelors, Prof-school, Assoc-acdm, Assoc-voc, Masters* или *Doctorate*)**" |
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.
ed = ['Bachelors', 'Prof-school', 'Assoc-acdm', 'Assoc-voc', 'Masters', 'Doctorate']
data[data.education.isin(ed)].salary.value_counts()['<=50K'] == 0
| "id": "cn-jYXhzutTl" | ||
| }, | ||
| "source": [ | ||
| "**8. Среди кого больше доля зарабатывающих много (>50K): среди женатых или холостых мужчин (признак *marital-status*)? Женатыми считаем тех, у кого *marital-status* начинается с *Married* (Married-civ-spouse, Married-spouse-absent или Married-AF-spouse), остальных считаем холостыми.**" |
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.
data['married'] = data['marital-status'].apply(lambda row: 1 if row.startswith('Married') else 0)
data[data.sex == 'Male'].groupby('married').salary.value_counts(normalize=True)
|
5 баллов |
| "id": "HgiqBXtb05qR" | ||
| }, | ||
| "source": [ | ||
| "data.groupby('Sex')['Age'].min()" |
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.
data[data.Year == 1992].groupby('Sex')['Age'].min()
| }, | ||
| "source": [ | ||
| "len(data[(data['Sex'] == 'M') & (data['Year'] == 2012) & (data['Sport'] == 'Basketball')]) / \\\n", | ||
| "len(data[(data['Sex'] == 'M') & (data['Year'] == 2012)])" |
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.
Забыли убрать дубликаты
| "id": "Y754OGI-05q3" | ||
| }, | ||
| "source": [ | ||
| "len(data[(data['Year'] == 2008) & (data['Team'] == 'Switzerland') & (data['Medal'] == 'Gold')])" |
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.
Не учтен теннис
|
4 балла |
No description provided.