Bar Plot Not Generating

Screen Link:
Schools-Copy1.ipynb (11.9 KB)

My Code:

import matplotlib.pyplot as plt
%matplotlib inline

What I expected to happen:
Bar plot to be generated of correlations between survey fields and ‘sat_score’ .

What actually happened:
Nothing. No error.

Replace this line with the output/error

Click here to view the jupyter notebook file in a new tab


all_survey = pd.read_csv("schools/survey_all.txt", delimiter="\t", encoding='windows-1252')
d75_survey = pd.read_csv("schools/survey_d75.txt", delimiter="\t", encoding='windows-1252')
survey = pd.concat([all_survey, d75_survey], axis=0)

survey["DBN"] = survey["dbn"]

survey_fields = [
survey = survey.loc[:,survey_fields]
data["survey"] = survey

Your mistake is in here, can you spot it? :smiley:

The code for the bar plot was a subcell of


So I guess the kernel doesn’t execute a cell if it does not have the line number in front of it.

I have viewed your notebook and the cell that this line of code was written is a markdown cell. I think this might be why your cell doesn’t have a line number before it. You can click here to see the shortcut to convert the cell to a code cell, or, you can simply click anywhere on the cell and on the toolbar above the notebook, you’ll see this area:

All you have to do next is to click “code” there and this will convert the markdown cell to a code cell. You can then execute it.

I’d highly recommend you check out this brief introduction to Jupyter Notebook shortcuts. They’ll save you a lot of time.

1 Like

Well, that last element in the list I posted would give a Syntax error right? I’m a bit confused, can we end list with separators these days :open_mouth:

I’ve checked it out on the command line Python interpreter and this gave no errors:

a = [3, 2,]

So, I’m guessing that you can end lists with separators, it’s just not a common practice.

1 Like

Oh wow! Thanks @dilarakrby I’ll just make this my signature code quirk from now on. :ok_hand:

1 Like