When working with data, you should always be aware that values could be missing.
.isna() – is a method that will tell you you how many NaN’s there are by returning the value True. NaN stands for Not a Number (i.e. blank).
![](https://rise.mmu.ac.uk/wp-content/uploads/image-425.png)
So if we run this code with the Titanic dataset…
![](https://rise.mmu.ac.uk/wp-content/uploads/image-426.png)
…we can see what data is missing by looking where the values have returned as True!
![](/wp-content/themes/rise-master/reimported/plugin/blocks/actionbox/assets/watch.png)
Watch: Missing Values
Watch the video to learn more about the significance of missing values in data.
You can also run the sum method on data to get a clearer idea of the number of NaNs in your dataset at first glance:
![](https://rise.mmu.ac.uk/wp-content/uploads/image-427.png)
So we can see clearly now that there is some data missing from some of the columns:
![](https://rise.mmu.ac.uk/wp-content/uploads/image-428.png)
We can also use the ~ character to show this. It is the reverse of the isna() method.
![](https://rise.mmu.ac.uk/wp-content/uploads/image-429-1024x550.png)
![](/wp-content/themes/rise-master/reimported/plugin/blocks/actionbox/assets/reflection.png)
Stop and Reflect:
What does the bar chart tell you about the data?
By looking at the chart above, you can see the data that is present. However, it can also tell you what is missing. What kind of data is missing from this dataset?