擅长:python、mysql、java
<p>为了这个(以及大多数的阴谋),我不会依赖matplotlib的熊猫包装器。相反,直接使用matplotlib:</p>
<pre><code>import matplotlib.pyplot as plt
plt.scatter(df['col_name_1'], df['col_name_2'])
plt.show() # Depending on whether you use IPython or interactive mode, etc.
</code></pre>
<p>记住,您可以使用<code>df.col_name_1.values</code>访问列值的NumPy数组。</p>
<p>我在使用Pandas默认绘图时遇到了问题,在时间戳值列的情况下,它的精度为毫秒。在尝试将对象转换为<code>datetime64</code>类型时,我还发现了一个令人讨厌的问题:<;<a href="https://stackoverflow.com/questions/26350364/pandas-gives-incorrect-result-when-asking-if-timestamp-column-values-have-attr-a">Pandas gives incorrect result when asking if Timestamp column values have attr astype</a>>;。</p>