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: |

Two days after Russia invaded Ukraine, an account on the Telegram messaging platform posing as President Volodymyr Zelenskiy urged his armed forces to surrender. "There are a lot of things that Telegram could have been doing this whole time. And they know exactly what they are and they've chosen not to do them. That's why I don't trust them," she said. On February 27th, Durov posted that Channels were becoming a source of unverified information and that the company lacks the ability to check on their veracity. He urged users to be mistrustful of the things shared on Channels, and initially threatened to block the feature in the countries involved for the length of the war, saying that he didn’t want Telegram to be used to aggravate conflict or incite ethnic hatred. He did, however, walk back this plan when it became clear that they had also become a vital communications tool for Ukrainian officials and citizens to help coordinate their resistance and evacuations. Since January 2022, the SC has received a total of 47 complaints and enquiries on illegal investment schemes promoted through Telegram. These fraudulent schemes offer non-existent investment opportunities, promising very attractive and risk-free returns within a short span of time. They commonly offer unrealistic returns of as high as 1,000% within 24 hours or even within a few hours. In addition, Telegram's architecture limits the ability to slow the spread of false information: the lack of a central public feed, and the fact that comments are easily disabled in channels, reduce the space for public pushback.
from ua


Telegram Machine learning Interview
FROM American