Object 'module' does not have attribute '_version_'

I use python and its pandas library, but I run into a problem all the time. During copying through the tutorial, I'm trying to get the version number for multiple libraries, but when I do, I get the following: AttributeError: 'module' object has no attribute '_version_'.

Everything else works fine, but really dislikes it '_version_'. Anything I can leave?

See below for the exact code.

import datetime
import pandas as pd
import pandas.io.data
from pandas import *
pd._version_
AttributeError: 'module' object has no attribute '_version_'
+4
source share
1 answer

Use double underscores.

In [10]: pandas.__version__
Out[10]: '0.13.1'

This is just a shorthand for pandas.version.version

PEP8 __version__ . , , , , (, Django).

+4

Source: https://habr.com/ru/post/1537648/


All Articles