Skip to content

Крайзель Андрей. Pandas and EDA#1

Open
AnesVijay wants to merge 8 commits intorailbotan:mainfrom
AnesVijay:main
Open

Крайзель Андрей. Pandas and EDA#1
AnesVijay wants to merge 8 commits intorailbotan:mainfrom
AnesVijay:main

Conversation

@AnesVijay
Copy link

No description provided.

}
],
"source": [
"mask = np.linspace(2, 12, 25).reshape(5,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.

Должно было быть mask = np.random.uniform(2, 12, (5, 5))

"print(True if p_inf in a else False)\n",
"for el in range(len(a)):\n",
" if a[el] == p_inf:\n",
" a[el] = 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.

Вместо цикла лучше применять
a = np.where(np.isnan(a) | np.isinf(a), 0, a)

"b = np.isnan(np.sum(a))\n",
"print(b)\n",
"p_inf = float('inf')\n",
"print(True if p_inf in a else False)\n",
Copy link
Owner

Choose a reason for hiding this comment

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

Лучше использовать функцию Numpy np.isinf(a)

@railbotan
Copy link
Owner

railbotan commented Mar 5, 2022

5 балла

@railbotan
Copy link
Owner

В 4-5 задании перепутали для среднеквадратических значений, взяли из dataframe_1, а надо было dataframe_2.

@railbotan
Copy link
Owner

В 6 задании
ed = ['Bachelors', 'Prof-school', 'Assoc-acdm', 'Assoc-voc', 'Masters', 'Doctorate']
print(data[data.education.isin(ed)].salary.value_counts()['<=50K'] == 0)

@railbotan
Copy link
Owner

5 баллов

@AnesVijay AnesVijay changed the title Крайзель Андрей Крайзель Андрей. Pandas and EDA Mar 18, 2022
@railbotan
Copy link
Owner

В задании №3 можно сделать так:
df_2 = data[(data["Year"] == 2000) & (data["Sex"] == "F") & (data["Sport"] == "Tennis")]

@railbotan
Copy link
Owner

5 баллов

@railbotan railbotan closed this Mar 19, 2022
@railbotan railbotan reopened this Mar 19, 2022
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