Telegram Group & Telegram Channel
Что выведет следующий код на Python (модуль statistics)?


import statistics as stats
import math

data = [1, 2, 2, float('nan'), 3, 4]

print("Mean:", stats.mean(data))
print("Median:", stats.median(data))
print("Mode:", stats.mode(data))


🔢 Варианты ответа:

A)

Median: 2.5
Mode: 2


B)

Median: 2.5
Mode: 2


C)ValueError: nan is not a valid number


D)

Median: nan
Mode: 2


Правильный ответ: C

💡 Почему?
- Модуль
statistics не умеет работать с NaN.
-
stats.mean() и stats.median() вызовут StatisticsError или ValueError.
- В отличие от
numpy.nanmean, здесь всё падает.
📌 Подвох — в
float('nan') в списке.



group-telegram.com/machinelearning_interview/1731
Create:
Last Update:

Что выведет следующий код на Python (модуль statistics)?


import statistics as stats
import math

data = [1, 2, 2, float('nan'), 3, 4]

print("Mean:", stats.mean(data))
print("Median:", stats.median(data))
print("Mode:", stats.mode(data))


🔢 Варианты ответа:

A)

Median: 2.5
Mode: 2


B)

Median: 2.5
Mode: 2


C)ValueError: nan is not a valid number


D)

Median: nan
Mode: 2


Правильный ответ: C

💡 Почему?
- Модуль
statistics не умеет работать с NaN.
-
stats.mean() и stats.median() вызовут StatisticsError или ValueError.
- В отличие от
numpy.nanmean, здесь всё падает.
📌 Подвох — в
float('nan') в списке.

BY Machine learning Interview


Warning: Undefined variable $i in /var/www/group-telegram/post.php on line 260

Share with your friend now:
group-telegram.com/machinelearning_interview/1731

View MORE
Open in Telegram


Telegram | DID YOU KNOW?

Date: |

Artem Kliuchnikov and his family fled Ukraine just days before the Russian invasion. Update March 8, 2022: EFF has clarified that Channels and Groups are not fully encrypted, end-to-end, updated our post to link to Telegram’s FAQ for Cloud and Secret chats, updated to clarify that auto-delete is available for group and channel admins, and added some additional links. Telegram does offer end-to-end encrypted communications through Secret Chats, but this is not the default setting. Standard conversations use the MTProto method, enabling server-client encryption but with them stored on the server for ease-of-access. This makes using Telegram across multiple devices simple, but also means that the regular Telegram chats you’re having with folks are not as secure as you may believe. Although some channels have been removed, the curation process is considered opaque and insufficient by analysts. The perpetrators use various names to carry out the investment scams. They may also impersonate or clone licensed capital market intermediaries by using the names, logos, credentials, websites and other details of the legitimate entities to promote the illegal schemes.
from us


Telegram Machine learning Interview
FROM American