I have a csv file with strings as x-axis. Now i have to make a scatter plot using matplotlib and pandas. But its showing error "scatter plots require number in x axis"
I tried reading the file as a variable df and scatter plotted it.But it isnt able is to read strings. Its a huge file and i cant define string variables as x = ["x1","x2",...etc]
*There are also multiple values for the same x axis id.
import matplotlib.pyplot as plt
import pandas as pd
df = pd.read_csv("scatter2")
ax = plt.gca()
df.plot(kind='scatter',x='Spectral Type',y='Hα EW',ax=ax)
The error message: ...ValueError: scatter requires x column to be numeric