How to make a basic graph of the scatter of a column in a DataFrame with respect to the index of this DataFrame? Im using python 2.7.
import numpy as np import pandas as pd import matplotlib.pyplot as plt dataframe['Col'].plot() plt.show()
Here's a Col line chart plotted against the values ββin my DataFrame index (dates in this case).
But how do I build a scatter plot, not a line chart?
I tried
plt.scatter(dataframe['Col']) plt.show()
But scatter() requires 2 arguments. So, how do I pass the dataframe['Col'] series and my dataframe index to scatter() ?
I tried for this
plt.scatter(dataframe.index.values, dataframe['Col']) plt.show()
But the schedule is empty.
source share