32
$\begingroup$

Pandas is a Python package providing fast, flexible, and expressive data structures designed to make working with “relational” or “labeled” data.

Just like Dataset[], it aims to be the fundamental high-level building block for doing practical, real world data analysis and has the broader goal of becoming the most powerful and flexible open source data analysis / manipulation tool available in any language. (For R users, DataFrame provides everything that R’s data.frame provides and much more.) Also, pandas is built on top of NumPy and is intended to integrate well within a scientific computing environment with many other 3rd party libraries.

Here are just a few of the things that both Pandas and Dataset[] do well:

  • Easy handling of missing data (represented as NaN) in floating point as well as non-floating point data
  • Size mutability: columns can be inserted and deleted from DataFrame and higher dimensional objects
  • Label-based slicing, fancy indexing, and subsetting of large data sets
  • Intuitive merging and joining data sets

Has anyone seen a more complete comparison of the pros and cons of each?

$\endgroup$
  • 17
    $\begingroup$ To the closers: while I don't have a very strong opinion here, I personally wouldn't mind having a technical comparison like the one asked here, on the site. I think this is one of the questions that allows us as a community to see the broader technology landscape. The question is not asked in a "which is better" manner, so I think that a reasonably objective feature comparison might be possible. $\endgroup$ – Leonid Shifrin Jul 28 '15 at 10:25
  • 4
    $\begingroup$ Agree w/ Leonid. It's likely to benefit the community. As of 2013 Rexer report, Mathematica isn't even in the top 10 systems for data analysis. $\endgroup$ – alancalvitti Aug 22 '15 at 14:14
  • $\begingroup$ @M.R. Interestingly, Dataset provides an internal type system and spreadsheet-like formatting, but Query works on (nested) Associations and Lists even w/o Dataset wrapper. $\endgroup$ – alancalvitti Aug 22 '15 at 14:17
  • $\begingroup$ I found it very useful because I am familier with SQL. I learned a lot of from the following videos: 1. youtube.com/watch?v=ks1iJSXy1CQ 2. youtube.com/watch?v=UBvjavJGWAg $\endgroup$ – madeinQuant Jan 21 '16 at 14:53
8
$\begingroup$

I have used both Mathematica and Pandas (with Jupyter) in the past year, both on moderately sized datasets and with a large amount of visualization.

My preferred style of programming is to write a package in either Wolfram Workbench (Mathematica) or PyDev (Python). I test the package code with mUnit or PyUnit. In day-to-day work I import the package into a Mathematica notebook or a Jupyter (iPython) notebook. In both cases I use eGit for version control.

In my experience, Mathematica offers a better set of tools. However, its biggest advantage is the consistency of the Wolfram language, although obviously after 30 years this comes at the price of some complexity, and not all of the recent changes to the language can be counted as improvements.

If you are thinking of Pandas, consider this:

In Pandas, there are two separate classes, the Series and the DataFrame. In many situations, where you expect to receive a "single column DataFrame", you actually get a Series, which has different methods and a different indexing scheme. This in itself is not so bad.

However, in a Python-based project you have to cope with Pandas DataFrames and Series, Numpy arrays, and basic Python lists. You end up doing a lot of conversions, especially if your retrieved data is being passed to functions and methods in other packages. The syntax for using each of these datatypes is different, and a huge nuisance to keep straight.

If you can accomplish everything you want entirely within Pandas, it might be easier to use. However, if you intend to write a significant amount of code outside of the data selection, you should base your decision on which environment would be best for your project.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.