3 ms·
pandas keeps turning me off, even if I feel like I ought to like it; I feel like I never really know what is going on, and the syntax feels like a domain-specif
by jonnycomputer 7y ago
pandas keeps turning me off, even if I feel like I ought to like it; I feel like I never really know what is going on, and the syntax feels like a domain-specific-language tacked on top of python, and it just doesn't sit well (my opinion!). Besides... some of the functions have an insane number of parameters, e.g.
pandas.read_table(filepath_or_buffer: Union[str, pathlib.Path, IO[~AnyStr]], sep='t', delimiter=None, header='infer', names=None, index_col=None, usecols=None, squeeze=False, prefix=None, mangle_dupe_cols=True, dtype=None, engine=None, converters=None, true_values=None, false_values=None, skipinitialspace=False, skiprows=None, skipfooter=0, nrows=None, na_values=None, keep_default_na=True, na_filter=True, verbose=False, skip_blank_lines=True, parse_dates=False, infer_datetime_format=False, keep_date_col=False, date_parser=None, dayfirst=False, cache_dates=True, iterator=False, chunksize=None, compression='infer', thousands=None, decimal=b'.', lineterminator=None, quotechar='"', quoting=0, doublequote=True, escapechar=None, comment=None, encoding=None, dialect=None, error_bad_lines=True, warn_bad_lines=True, delim_whitespace=False, low_memory=True, memory_map=False, float_precision=None)
I use R happily enough, and MATLAB too for that matter. Maybe, some-day, I'll see the pandas-light.
- prepend 7y agoWhy do you not like so many parameters? They are optional so typically pandas only has one or two required parameters.
- jonnycomputer 7y agoCallables requiring many parameters is often indicative that the code is doing too much, perhaps as coder after coder tweaked it to handle their particular use-case. I am not a big fan of (the over-use of) optional arguments either: I prefer code I'm reading to be more explicit, which is more pythonic imo.
- cometsong 7y agoI agree on over-use of optionals. I disagree with the code is thus doing too much, however. At least in this specific and some other cases, the method shown there is a wrapper to do a major task of converting data formats from one form to another. These optional, well-documented arguments show the defaults used, and are modifiable in, as you said, specific use-cases.
- msquog 7y agoLearning pandas really does feel like learning a new language - new syntax, idioms and implementation details to be aware of. Much more so than other libraries imo. Given how utterly powerful it is, I think that's OK. Not sure a large list of optional params (with good documentation) is a bad thing though.