Asking Good Questions

Asking Good Questions
Author

Kelly Nascimento Thompson

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:

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

Question: Cannot plot a histogram from a Pandas data frame

Answer: First, you need to import the Histogram class from the Matplotlib library.

import matplotlib.pyplot as plt

Then, you can use the plot() method which will accept a dataframe column as an argument.

plt.hist(df[‘column’], color=‘blue’, edgecolor=‘black’, bins=int(45/1))

Source: https://vitalflux.com/histogram-plots-using-matplotlib-pandas-python/

Link: (https://stackoverflow.com/a/75250948/21082634)

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

The reading “Asking Good Questions” from the stack overflow platform outlined the importance of summarizing the problem in the title, writing some introductory text before posting code, and helping others reproduce the problem by posting reprex, mcve, and mwe codes.

The question I answered to on stack overflow had a good title “Cannot plot a histogram from a Pandas data frame”, but the user did not provide example code to reproduce the problem. He provided some ways he tried to solve the problem with methods applied, but I can not tell if he imported the correct packages to run the code or what the output would of his problem will look like due to the lack of example code.

His question seemed easy to find an answer online, thus, some “Search and Research”could have easily solved his problem. I found an article discussing his problem and linked it in my answer.