Pole a vizualizace

Python pro uživatele MATLABu

Justin Kiggins

Product Manager

Pole NumPy

  • Pole = matice
  • Pole mohou být vícerozměrná
  • Všechny prvky jsou stejného typu
Python pro uživatele MATLABu

Indexování v polích NumPy

print(arr)
[[2, 4, 8, 16, 32]]
  • Indexování od nuly
print(arr[2])
8
print(arr[0])
2
print(arr[-1])
32
Python pro uživatele MATLABu

Vizualizace dat pomocí Matplotlib

Příklad vizualizace v Matplotlib

Python pro uživatele MATLABu

Použití Matplotlib

import matplotlib.pyplot as plt
# Create a new figure
plt.figure()

# Plot y as a function of x plt.plot(x, y)
# Set the x-label and y-label plt.xlabel('x') plt.ylabel('y')
# Be sure to show the plot! plt.show()

Python pro uživatele MATLABu

Pojďme cvičit!

Python pro uživatele MATLABu

Preparing Video For Download...