Asking Good Questions

Asking Good Questions
Author

An Pham

Published

January 26, 2023

Prompt:

Asking good questions is a valuable skill to have - asking questions in an online setting is both easier and harder than asking questions in person: we can prepare to ask a question but we are also expected to prepare. The links posted here give some advice on how to ask good questions:

Follow these links and read through the advice given, then

  1. Pick at least one question from stackoverflow or the R help and answer it.

Write a blog post answering the following questions: Using If /Else Statement Operator in Pandas/Python The problem was introduced before code was given (as related from ‘asking a good question’ guide). The author was having trouble with conditionally filling his/her new column in a dataframe. He/she used an anonymous function (lambda) to add values as desired.

  1. Document which question you answered (link to your answer). Link to my answer

  2. Relate your experience of answering the question to your reading.

The question was straightforward and details of the output were described in many scenarios. It “includes just enough code to allow others to reproduce the problem” (as posted in the ‘minimal complete verifiable example’ guide). Because of that, I guessed that they accidentally assign values to the same cell in the dataframe, which seemed suspicious.

I thought that the conditions should be structured in an if-elif-else instead of two separate if-else commands. I double checked the correct if-elif-else structure of an anonymous function and found a StackOverflow post on that. Next, I tried to explain the issue he/she was having and propose a solution as well as the link to the original answer on StackOverflow. Eventually, I rewrote the code in his/her context to make sure they understand my point.

It was my first time ever answering a StackOverflow question. I am not sure if the author figured it out yet (there was no update up to when I submitted this homework) but I feel good for being a part of an awesome community that helped me a lot during my first year. Thank you for the meaningful homework!

Instructions to follow.