1

Quarter is seasonal data, such as '2009Q1','2010Q4'... Size is a float data, such as '12.1', '14.3' ... The data type is as below:

Quarter                            object
Size                              float64

While I try to plot these two columns, there is an error:

plt.plot('Quarter','Size')   
plt.show()

Error:

ValueError: Unrecognized character S in format string

Does it mean I need to transfer the season data to another format? I do not know how to change the type. Thanks!

1 Answer 1

3

To plot your data, you have to pass the variables into the function parameters, whereas you are passing strings that are the same as the variable names. To plot the actual data:

// this
plot(Quarter, Size)

// NOT this
plot('Quarter', 'Size')

To use the axis labels, you have to run plot like:

plot('xlabel', 'ylabel', data=obj)

Just put your data object into the function and it should plot it how you like. Otherwise look here for documentation on plotting.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.