Home/Support/Support Forum/Python - TypeError – NoneType Object not Subscriptable
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Python - TypeError – NoneType Object not Subscriptable

0 votes
asked Sep 23, 2020 in 3rd Party Python and API development in other Languages by DigiTMG New to the Community (0 points)

Please log in or register to answer this question.

2 Answers

0 votes
The error is self-explanatory. You are trying to subscript an object which you think is a list or dict, but actually is None. This means that you tried to do:


This error means that you attempted to index an object that doesn't have that functionality. You might have noticed that the method sort() that only modify the list have no return value printed – they return the default None. 'NoneType' object is not subscriptable is the one thrown by python when you use the square bracket notation object[key] where an object doesn't define the __getitem__ method . This is a design principle for all mutable data structures in Python.

answered Oct 21, 2020 by rickberon New to the Community (1 point)
0 votes
Python has two ways of representing missing data that are NaN and Na. The NaN means “Not a Number”, and it means there is a result, but it cannot be represented in the computer. The second is NA means Not Available, which means that the data is missing for unknown reasons. Let’s deep dive into NA in Python.
answered Jan 4 by rushabh92 New to the Community (1 point)