Find Documentation and Ask for Programming Help
Learning goals
- I can reduce a problem to a minimal reproducible example.
- I can search for a function, an exact error, and the documentation for my installed version.
- I can distinguish a tutorial, user guide, API reference, and community answer.
- I can ask the teacher or an online community a question that includes enough evidence to reproduce the issue.
Where this fits
Basic schematics and the five KCL/KVL questions are already complete. This lesson begins the computational-verification stage: use code to check equations, diagnose faults, and document evidence before moving into capacitors and RC response.
This is not a one-day skill. Begin with working code, then practise an easy documentation lookup, an exception-driven repair, and finally a plausible wrong answer that requires an independent check.
The help ladder
Use the first level that can answer the question. Record what you learned before moving down the list.
- Read the last line of the error and the line that caused it.
- Reproduce the issue in the smallest possible cell.
- Inspect values, types, shapes, column names, units, versions, and file locations.
- Use Python or Jupyter help.
- Search the official documentation.
- Search existing Stack Overflow questions.
- Ask a complete question using the template below.
The goal is not to avoid asking for help. The goal is to make the question answerable.
1. Reproduce the issue
Save the notebook, restart the kernel, and run from the first cell. Then make a small copy that still produces the same problem.
import sys
import pandas as pd
print(sys.executable)
print(sys.version)
print("pandas", pd.__version__)For a pandas problem, also inspect the data structure instead of guessing:
print(type(data))
print(data.shape)
print(data.columns.tolist())
print(data.head())
print(data.dtypes)Copy errors as text. Do not submit a photograph of code or an error when the text can be copied.
Remove names, student numbers, tokens, passwords, private file paths, and confidential data. Replace a large or private dataset with a few invented rows that still reproduce the behaviour.
2. Ask Python and Jupyter first
Use the object you are actually calling:
help(pd.read_csv)In a Jupyter cell, a question mark shows the signature and documentation:
pd.read_csv?For a method on a DataFrame:
data.dropna?Read the signature, parameters, returns, raises, and examples. Check whether the documented requirement matches your input type, array shape, column name, path, or unit.
3. Search the web deliberately
A useful search normally contains:
library + function + exact error or unexpected behaviour
Examples:
pandas read_csv FileNotFoundError Jupyter relative path
numpy linalg solve matrix must be square
matplotlib plot x and y different first dimension
Put a distinctive error fragment in quotation marks when the search is too broad:
pandas read_csv "No such file or directory" Jupyter
Limit a search to an authoritative site when needed:
site:pandas.pydata.org pandas read_csv usecols
site:numpy.org numpy linalg solve shape
site:docs.python.org pathlib current working directory
site:stackoverflow.com pandas KeyError column name
Do not paste the first result into the notebook. Compare it with the installed package version, understand which line changes, and verify the result independently.
4. Read pandas documentation
Use the pandas getting-started material when the concept is new, the pandas User Guide for explanations by topic, and the pandas API reference for the exact signature and behaviour of a function or method.
For example, the pandas.read_csv reference answers questions about paths, separators, headers, selected columns, missing values, and returned objects.
Record four pieces of documentation evidence:
- the page title and link;
- the package version shown on the page and your installed version;
- the relevant parameter, return value, exception, or example;
- one sentence explaining how that requirement applies to your code.
5. Search Stack Overflow
Search before posting. Start with the exact error, language, library, and function. Read more than the accepted code snippet:
- Does the question describe the same input and goal?
- Which package and Python versions were involved?
- Is the answer old enough that the API may have changed?
- Do comments or newer answers identify a limitation?
- Can you explain the suggested change before running it?
Stack Overflow community answers are leads, not authority. Confirm important details in the current official documentation and test the proposed fix on the minimal example.
6. Create a minimal reproducible example
Stack Overflow calls this an MRE: minimal, reproducible example.
- Minimal: remove unrelated imports, cells, files, and data.
- Complete: include every import, variable, and small input needed to run it.
- Reproducible: restart and verify that the example produces the reported result.
Example small dataset:
import pandas as pd
data = pd.DataFrame(
{
"voltage_V": [2.0, 4.0, 6.0],
"current_mA": [2.1, 4.0, 6.2],
}
)
print(data["current_ma"].mean())The example is short, contains its own data, and reproduces the column-name problem without requiring somebody else to download a private CSV file.
Read Stack Overflow’s official guidance on asking a good question and creating a minimal reproducible example before posting.
7. Ask the teacher using the same standard
Do not send only “it does not work,” a full notebook with no explanation, or a screenshot with the important text cut off. Use this template in the notebook, email, or classroom help request.
### Goal
I am trying to ...
### Expected result
I expected ... because ...
### Actual result
Instead, ...
### Exact error or failed check
Paste the complete final exception line or the incorrect output as text.
### Minimal code and input
Paste the smallest runnable example.
### Environment
Operating system:
Python version:
Package versions:
Jupyter kernel/interpreter path:
### What I tried
1. I ...
2. I ...
### Sources I checked
- Documentation or question link:
- Relevant requirement or example:
### My current hypothesis
I think the problem may be ... because ...
### Focused question
What assumption, input, or documented requirement should I check next?This lets the teacher see your reasoning, reproduce the issue, and teach the missing idea instead of guessing what happened.
8. Draft a Stack Overflow question
Posting publicly is not required for this course. A student can draft the question for assessment or teacher review without creating an account or publishing it.
A strong public question contains:
- a specific title that states the unexpected behaviour;
- a short explanation of the goal and context;
- expected and actual results;
- the exact error as text;
- a minimal reproducible example in code blocks;
- relevant Python, library, operating-system, and Jupyter versions;
- what was tried and why it did not answer the question;
- links to related documentation or questions;
- one focused question;
- appropriate tags such as
python,pandas, andjupyter-notebook.
Do not post the entire assignment and ask somebody to solve it. Do not include private information, classroom answer keys, copyrighted course material, or images of text that should be searchable and copyable.
Worked help-request example
Weak: “Pandas is broken. My file will not load. What do I do?”
Stronger:
In JupyterLab,
pd.read_csv("circuit-measurements.csv")raisesFileNotFoundError, although the CSV appears in my Windows Downloads folder. The notebook is running from WSL, andPath.cwd()reports/home/student/tej-computational-engineering/notebooks. I confirmed pandas 2.x and read theread_csvpath documentation. I think I am confusing the Windows Downloads path with the notebook’s Linux working directory. What is the cleanest way to place or reference the CSV so the notebook remains portable?
The stronger request gives a goal, exact symptom, environment, evidence, hypothesis, and focused question.
Submission check
Next step
First practise this protocol in Python and NumPy Foundations, where one incorrect keyword must be repaired from the documentation. Then use the same protocol in Notebook 3: Kirchhoff Systems and carry the evidence standard into pandas data work, RC modelling, and the independent investigation.
Help improve this lesson (optional)
If a search step, documentation example, or help-request field was unclear, tell the teacher what got in the way and one change that would help the next student. If you can improve an example or screenshot, show the teacher. A useful fix may be added to the course website and credited to you.