Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> Python

วิธีตรวจสอบเวอร์ชันของ Pandas และ Dependencies ใน Python

Pandas เป็นแพ็กเกจสำคัญสำหรับการวิเคราะห์ข้อมูลใน Python มีเวอร์ชันต่างๆ มากมาย และการไม่ตรงกันของเวอร์ชันอาจทำให้เกิดปัญหา ดังนั้นเราจึงต้องทราบวิธีตรวจสอบหมายเลขเวอร์ชันของ Pandas ซึ่งสามารถทำได้ง่ายๆ ด้วยโค้ดต่อไปนี้

ตรวจสอบเวอร์ชัน Pandas

ใช้คำสั่งดังนี้เพื่อดูเวอร์ชัน:

pandas.__version__

ตัวอย่าง

>>> import pandas as pd
>>> print(pd.__version__)
0.25.2
>>>

ตรวจสอบเวอร์ชันของ Dependencies

เราสามารถดูเวอร์ชันของ dependencies ที่ติดตั้งร่วมกับ Pandas ได้โดยใช้ฟังก์ชัน:

pandas.show_versions()

ตัวอย่างผลลัพธ์

>>> pd.show_versions()
INSTALLED VERSIONS
------------------
commit           : None
python           : 3.7.1.final.0
python-bits      : 64
OS               : Windows
OS-release       : 7
machine          : AMD64
processor        : Intel64 Family 6 Model 60 Stepping 3, GenuineIntel
byteorder        : little
LC_ALL           : None
LANG             : None
LOCALE           : None.None
pandas           : 0.25.2
numpy            : 1.15.3
pytz             : 2018.7
dateutil         : 2.7.4
pip              : 19.2.2
setuptools       : 39.0.1
Cython           : None
pytest           : None
hypothesis       : None
sphinx           : None
blosc            : None
feather          : None
xlsxwriter       : None
lxml.etree       : 4.2.5
html5lib         : None
pymysql          : None
psycopg2         : None
jinja2           : None
IPython          : None
pandas_datareader: None
bs4              : 4.6.3
bottleneck       : None
fastparquet      : None
gcsfs            : None
lxml.etree       : 4.2.5
matplotlib       : 3.0.1
numexpr          : None
odfpy            : None
openpyxl         : None
pandas_gbq       : None
pyarrow          : None
pytables         : None
s3fs             : None
scipy            : None
sqlalchemy       : None
tables           : None
xarray           : None
xlrd             : None
xlwt             : None
xlsxwriter       : None
>>>