Skip to content

Incorrect 'unsubscriptable-object' reported #3637

@qsmy41

Description

@qsmy41

Steps to reproduce

Running Pylint on the following code will produce the error on the last line.

import statsmodels.api as sm

data = sm.datasets.longley.load_pandas().data

properties = ['GNP', 'POP']
specificData = data[properties]

Current behavior

Running Pylint gives

example.py|6 col 16 error| E1136: Value 'data' is unsubscriptable (unsubscriptable-object)
example.py|6 col 16 error| unsubscriptable-object: Value 'data' is unsubscriptable

Expected behavior

No errors/warnings should be produced.

pylint --version output

pylint 2.5.2
astroid 2.4.1
Python 3.7.7 (default, Apr 14 2020, 11:51:19)
[Clang 11.0.0 (clang-1100.0.33.12)]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug 🪲False Positive 🦟A message is emitted but nothing is wrong with the code

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions