I have checked some other SO answers and googled somewhat extensively and cannot seem to find someone who has asked/answered this:
I am running Ubuntu 12.04. I have python2.7 and python3.2 installed. (I ran sudo apt-get install python-numpy, python3-numpy, and similar with scipy). I ran sudo apt-get install python-pandas. It works perfectly fine with python2.7. It does not import in python3.2 I then modified my $PYTHONPATH to have the directory where pandas was installed, full aware that this might create an issue:
/usr/lib/pymodules/python2.7
Now when I try to import, I get
>>> import pandas
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/pymodules/python2.7/pandas/__init__.py", line 10, in <module>
import pandas.lib as lib
ImportError: /usr/lib/pymodules/python2.7/pandas/lib.so: undefined symbol: _Py_ZeroStruct
So I've obviously missed something here. As a note, since I've just been doing all these python installations myself, and am still learning, my $PYTHONPATH may need updating; right now the only thing in it is the directory mentioned above. Are there other directories I should have in there, standardly?
(If you need any more information about my system, etc., please just comment.)
Pandas is an open source Python package that is most widely used for data science/data analysis and machine learning tasks. It is built on top of another package named Numpy, which provides support for multi-dimensional arrays.
Pandas is built on top of two core Python libraries—matplotlib for data visualization and NumPy for mathematical operations. Pandas acts as a wrapper over these libraries, allowing you to access many of matplotlib's and NumPy's methods with less code.
Cython (writing C extensions for pandas) For many use cases writing pandas in pure Python and NumPy is sufficient. In some computationally heavy applications however, it can be possible to achieve sizable speed-ups by offloading work to cython.
What is Pandas? Pandas is a Python library used for working with data sets. It has functions for analyzing, cleaning, exploring, and manipulating data. The name "Pandas" has a reference to both "Panel Data", and "Python Data Analysis" and was created by Wes McKinney in 2008.
You may just install it by sudo apt-get install python3-pandas
if you'd prefer a system-wide installation
As mentioned below, pandas is now available for python 3.3, 3.4 and 3.5 source
For system wide install use:
sudo apt-get install python3-pandas
If this information http://packages.ubuntu.com/precise/python/ is correct there is no pandas package for Python 3. You can install current pandas using virtualenv:
apt-get install python-virtualenv virtualenvwrapper
mkvirtualenv -p python3 pandas_env
pip install pandas
Generally it is a good idea to create separate virtual environments when working with Python and to avoid manual messing with system wide packages.
there is a python3-pip which will install pip-3.3 instead of pip. the pip-3.3 will install the pandas package into python3.3
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With