8

I often find myself typing out pandas dataframes from scratch when I'm answering a pandas question that did not provide the dataframe's source code, only the output.

It's very time consuming. I can type out a simple dummy dataframe, but it doesn't make me feel right that the dataframe in my answer greatly differs from the one in the question.

I want to know, does not including the dataframe's source code count as non-reproducible code? I'm not talking about giant dataframes fron cvs files, only the ones that the OP used code to generate in the first place, like a dict.

13
  • 1
    Depends on the context Jul 6, 2020 at 16:52
  • It may take more time, but you were able to answer. Assuming there's nothing else wrong with the question (and you didn't have to do guesswork, just come up with a test dataframce to demonstrate your solution), I'd say it doesn't quite make the question non-reproducible. Might be worth just commenting and asking the OP politely to add a sample dataframe to the question. Jul 6, 2020 at 16:59
  • @StoryTeller-UnslanderMonica Yeah, I always ask, and can only pray the OP responds :/
    – Ann Zen
    Jul 6, 2020 at 17:00
  • 23
    You should just spend your time on more deserving questions @Ann. No one is entitled to your free time. Don't do this if it's a chore. Jul 6, 2020 at 17:01
  • If you have all the details necessary to answer the question then you can't say it is missing reproducible example. If you have to make guesses or generalizations then it means the question should probably be closed. If the question has the details necessary, but not in a handy format then it's not worth your time. Just downvote and move on.
    – Dharman Mod
    Jul 6, 2020 at 17:52
  • @Dharman I've heard that a question should provide enough code so that users can simply copy-paste to reproduce the problem.
    – Ann Zen
    Jul 6, 2020 at 18:05
  • No, the code needs to clearly show the problem. Often it will not be possible to copy it and run on your machine without boilerplate, configuration or other irrelevant things which were removed from MCVE. The help page describes how to make such code. The code in the question should be just enough for you to reproduce the issue yourself, not copy-paste
    – Dharman Mod
    Jul 6, 2020 at 18:10
  • @AnnZen is "but it doesn't make me feel right that the dataframe in my answer greatly differs from the one in the question" causing you the problem? Because there is no requirement for code in answer to match code in the question... so consider not spend time on matching OP's code. Jul 6, 2020 at 20:03
  • @AlexeiLevenkov There's always "what would newbies think?".
    – Ann Zen
    Jul 6, 2020 at 20:20
  • 1
    Yes, it does not. Why do you have any doubt?
    – philipxy
    Jul 7, 2020 at 2:54
  • @philipxy "Yes, it does not." Does not count as non-reproducible?
    – Ann Zen
    Jul 7, 2020 at 2:56
  • 1
    I don't understand your comment. I am answering your title question. A MRE should be as cut & paste & runnable as possible. (I disagree with comments here, which just promote poor questions.) PS Unfortunately your title & especially your post are made unclear by your many negations, some of which seem to be included to show you have doubts, but all the negation makes it hard to follow & to phrase an answer in terms of whatever the question was, whatever it was.
    – philipxy
    Jul 7, 2020 at 3:02
  • @Dharman Disagree on "just enough [...] to reproduce the issue" means "not copy-paste". An MCVE/MCE/RePrex should be minimal and complete, which means copy-paste. There are tons of questions out there in which the OP left away some seemingly easy to guess element that actually triggers the problem. Put the wiggle room in the meaning of "should", not the requirements. Aug 6, 2020 at 7:40

1 Answer 1

6

As someone who spent a lot of time in the pandas tag and subsequently burned out for mainly this reason, here's how I handle it:

  1. Is the question an obvious duplicate? In other words, if I spend less than 2-5 minutes Googling for duplicates, would I find something that fits?
  2. Is the question well asked, containing input data and output as text (not images) with the output explained appropriately? I consider code to be a bonus here but not always required, sometimes even getting to this point is an accomplishment.

Unfortunately IMO 60% (if not more) of questions do not even satisfy these basic constraints. Of the ones that don't fall into that category, so many are so absurdly specific, localized, or pigeonholed to a niche topic that you doubt it would ever become a useful source for future readers. That doesn't necessarily mean the question is bad, just that I would not think the payoff for the effort of answering said question is worth it.

TLDR; most new pandas questions are just not worth answering. Instead consider dedicating your efforts to improving older pandas questions — ensuring their information is up to date — and compiling lists of duplicates to close new questions, much like this one.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .