-2

I have been trying to extract some data from a DataFrame, where I ran into this issue. While I am trying to plot a line plot using matplotlib.plot (column_name) The DataFrame had the column name " Ladder score" But this cannot be executed in the matplotlib plot function, we can't use space between words. But the given column in DataFrame has the column name like that. How can I overcome this issue?

Image of error:

image of error

7
  • Access to the error is denied for me (may need to make it available to anyone with the link)
    – cmay
    Commented Nov 7, 2021 at 2:59
  • 2
    Please include any relevant information as text directly into your question, do not link or embed external documents. We expect images to be self contained.
    – Henry Ecker
    Commented Nov 7, 2021 at 3:03
  • Changed the permission now and I can't upload any image here, showing that "I can't do that"
    – Ibu
    Commented Nov 7, 2021 at 3:04
  • 1
    The main point of Henry's comment is that code/errors/data should be pasted as text, not images.
    – tdy
    Commented Nov 7, 2021 at 3:12
  • 1
    the dot-accessor of columns in a dataframe is for convenience only, and works only when the names are valid python identifiers
    – Paul H
    Commented Nov 7, 2021 at 3:47

1 Answer 1

0

Just call your plot using

plt.plot(b[" Ladder score"])

Not the answer you're looking for? Browse other questions tagged or ask your own question.