@amneumarkt · Post #721 · 16.01.2026 г., 06:26
#visualization This is actually smart. https://medium.com/@redhotchilipaper/using-trapezoids-to-visualize-matrix-multiplication-with-applications-to-data-science-e1cff40de098
Hashtags
TGINSIGHT SIMILAR POSTS
Изворен канал @pythonotes · Post #32 · 7 фев.
Скорее всего уже слышали, что складывать строки через + это плохая практика. Падение производительности, и всё такое. Без лишних слов, давайте измерять: from timeit import timeit def t1(): # складываем 10 строк через + из переменной t = 'text' for _ in range(1000): s = t + t + t + t + t + t + t + t + t def t2(): # склеиваем список строк через метод join arr = ['text'] * 10 for _ in range(1000): s = ''.join(arr) def t3(): # складываем через + но не из переменной а непосредственно инлайн объекты for _ in range(1000): s = 'text' + 'text' + 'text' + ... # всего 10 раз Теперь каждую строку склейки запустим по 10М раз >>> timeit(t1, number=10000) 0.21951690399964718 >>> timeit(t2, number=10000) 1.4978306379998685 >>> timeit(t3, number=10000) 0.2213820789993406 Хм, а нам говорили что через "+" это плохо и медленно ))) 😁 Тут стоит учитывать, что речь идёт о склейке множества длинных строк. Давайте изменим условия: def t4(): t = 'text'*100 for _ in range(1000): s = t + t + t + t + t + t + t + t + t def t5(): arr = ['text'*100] * 10 for _ in range(1000): s = ''.join(arr) def t6(): for _ in range(1000): s = 'text'*100 + 'text'*100 + ... # всего 10 раз >>> timeit(t4, number=10000) 12.795130728000004 >>> timeit(t5, number=10000) 2.642637542999182 >>> timeit(t6, number=10000) 0.2184546610005782 Вот, уже другой разговор, сразу видна разница, в среднем в 6 раз. Но погодите, почему последний тест t6() по скорости такой же как и t3()? Ведь строки теперь в 100 раз длиннее! Это вопросы оптимизации кода, какие простые изменения ускоряют или замедляют выполнение программы. Мы столкнулись с примером обхода обращения к переменной. Например, именно так работает директива #define в С++, во время компиляции подставляя значение переменной вместо ссылки на неё. В Python это тоже работает, но часто ли вы сможете встретить такой способ работы со строками? К сожалению, способ почти только теоретический. В целом, тесты показали то, что мы хотели. Делаем выводы самостоятельно. Полный листинг 🌍 #tricks
Пребарај: #visualization
@amneumarkt · Post #721 · 16.01.2026 г., 06:26
#visualization This is actually smart. https://medium.com/@redhotchilipaper/using-trapezoids-to-visualize-matrix-multiplication-with-applications-to-data-science-e1cff40de098
Hashtags
@amneumarkt · Post #713 · 19.12.2025 г., 17:44
#visualization Broken Chart: discover 9 visualization alternatives – Dr Dominic Royé https://dominicroye.github.io/blog/2025-12-14-broken-charts/
Hashtags
@amneumarkt · Post #649 · 05.12.2024 г., 21:01
#visualization introduction | Deneb https://deneb-viz.github.io/
Hashtags
@amneumarkt · Post #646 · 29.11.2024 г., 04:09
#visualization Plotly will supports polars natively in v6 . https://github.com/plotly/plotly.py/releases/tag/v6.0.0rc0
Hashtags
@amneumarkt · Post #643 · 24.11.2024 г., 15:57
#visualization Dashboard Deutschland https://www.dashboard-deutschland.de/
Hashtags
@amneumarkt · Post #619 · 04.09.2024 г., 17:35
#visualization The Data Viz Tools We Used In 2023 https://data-viz-tools-2023.netlify.app
Hashtags
@amneumarkt · Post #614 · 18.08.2024 г., 07:47
#visualization There was a joke saying that every tree in Germany has been touched by some human. There's even a research on the topic of how dense the buildings are in Germany. Based on this research, the farthest distance that is away from a building is only 6.3km. I just can't believe this. I feel something is wrong but I don't have data to validate. Behnisch, Martin, Martin Schorcht, Steffen Kriewald, and Diego Rybski. 2019. “Settlement Percolation: A Study of Building Connectivity and Poles of Inaccessibility.” Landscape and Urban Planning 191 (103631): 103631.
Hashtags
@amneumarkt · Post #592 · 27.06.2024 г., 21:56
#visualization Beautiful. There are details that the author designed quite well. How long are the nights? https://plotparade.com/gallery_sunrise.html
Hashtags
@amneumarkt · Post #566 · 29.03.2024 г., 13:55
#visualization Some comments in this post are just so funny. https://www.reddit.com/r/MapPorn/s/HsLvLGzLb6
Hashtags
@amneumarkt · Post #518 · 20.12.2023 г., 08:35
#visualization Source: https://www.statista.com/statistics/520952/netherlands-number-of-live-born-children-by-marital-status-of-the-mother/
Hashtags
@amneumarkt · Post #514 · 01.12.2023 г., 15:12
#visualization Finland vs UK, and Turkiye/Turkey is such a nice example of data quality issues. https://www.reddit.com/r/MapPorn/s/QYGauVmzOP
Hashtags
@amneumarkt · Post #505 · 09.11.2023 г., 19:13
#visualization https://www.reddit.com/r/dataisbeautiful/s/V05LnvCzqC
Hashtags