J
J
julialyas2020-05-08 12:01:40
Python
julialyas, 2020-05-08 12:01:40

Yandex Workshop Python Table Operations Lesson 8. How to solve a problem?

The challenge itself: Some cells in the Twitter data column are null. This is due to the fact that emoji are rarely used and there is no information about them in the source. Zero values ​​are not always convenient in practice - for example, you cannot divide by them. Since the real values ​​are unknown, a very small amount can be added to all. This will fix the problem, and the values ​​for the rest of the cells won't mess up too much.
Change the values ​​of the twitter list: add 0.001 to each element. Print the result on the screen.

Solution:
twitter = [
87.3, 150, 0.0, 2270.0, 264.0, 565.0, 834.0, 432.0, 0.0, 478.0,
198.0, 654.0, 98.7, 445.0, 1080.0, 697.0, 227.0, 0.0, 15
code

here ] >

print(twitter)

I seem to be doing everything right, but I need to add 0.001 to the values, I try and it doesn’t work. What’s wrong? Please help

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Z
zexer, 2020-05-08
@zexer

UPDATE
[i + 0.0001 for i in twitter]

N
Nikolay, 2020-05-08
@SODINNER

Write to those Yandex support, why are you writing here? Yandex created a task, they will help you solve it, you already checked it, is it so difficult or what? Moreover, it is written everywhere and in the corner still constantly pops up with all possible contacts.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question