【发布时间】:2017-03-26 06:29:09
【问题描述】:
我正在使用 plt.plot 使用在线找到的信息绘制图表。
但是,我不知道 y[:,0] 是什么意思:
plt.plot(t, y[:,0], label= 'active Mos')
同样,我也经常看到 y[:,1]...
plt.plot 是在图形上画一条线,对吧?
【问题讨论】:
-
通过它但在任何地方都看不到符号中的 ,...
我正在使用 plt.plot 使用在线找到的信息绘制图表。
但是,我不知道 y[:,0] 是什么意思:
plt.plot(t, y[:,0], label= 'active Mos')
同样,我也经常看到 y[:,1]...
plt.plot 是在图形上画一条线,对吧?
【问题讨论】:
这是 Numpy/Pandas 中使用的一种表示法。
[ : , 0 ] 表示(或多或少)[ first_row:last_row , column_0 ]。如果您有一个二维列表/矩阵/数组,则此表示法将为您提供第 0 列中的所有值(来自所有行)。
【讨论】: