TGViewer
Python Portal Python Portal @pythonportal · 50.1K subscribers
Post #5143 8.53K
Как создать синусоидальную волну на Python с помощью Bokeh и NumPy 🐍

import numpy as np

from bokeh.layouts import gridplot
from bokeh.plotting import figure, output_file, show

N = 100
x = np.linspace(0, 4 * np.pi, N)
y0 = np.sin(x)

output_file('sinewave.html')

sine = figure(width=500, plot_height=500, title='Sine')
sine.circle(x, y0, size=10, color="navy", alpha=0.5)

p = gridplot([[sine]], toolbar_location=None)

show(p)


👉 @PythonPortal
  • 🤝 25
  • ❤ 13
  • 🔥 4
More from @pythonportal
  1. Oct 11, 2026Разбор собеседований по проектированию систем, разделённый на 28 глав. Рассматриваются мас…
  2. Oct 11, 2026Вышла долгожданная новая версия Python — 3.15 🐍 В неё вошли 5643 коммита от тысячи разраб…
  3. Oct 10, 2026Сейчас в сфере ИИ есть два карьерных пути: Первый — разработчик, который умеет создавать п…
  4. Oct 10, 2026Скачайте 10 книг по Python БЕСПЛАТНО: 1. Think Python — O’Reilly https://t.co/X7y3pX68IW 2…
  5. Oct 9, 2026Один из главных моментов, когда я по-настоящему понял, как работают трансформеры: «Переста…
  6. Oct 9, 2026Google выпустила EmbeddingGemma 2. Это первая открытая мультимодальная модель для эмбеддин…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →