yashdw – Data Wrangling Practical 1
A small Python package holding solutions to the 10 questions of
Data Wrangling Practical 1, runnable from Jupyter with yashdw.q1() … yashdw.q10()
or the shortcut yashdw.1 … yashdw.10.
The 10 questions (from the practical file)
| # | Task | Libraries |
|---|---|---|
| 1 | data = [25..60]: mean, median, max, min |
statistics |
| 2 | marks: mean, median, mode, range | statistics |
| 3 | production: mean, variance, std, max, min | numpy |
| 4 | NumPy array: mean, median, variance, std (2 decimals) | numpy |
| 5 | DataFrame of machine output: mean, median, std, describe() |
pandas |
| 6 | 20 random integers 50–100: mean, variance, std, max, min | numpy |
| 7 | inspection data: mean, median, variance, std, low/high variation | numpy |
| 8 | Machine A: mean, std, variance, coefficient of variation, consistency | numpy |
| 9 | Machine A vs B: means, stds, more consistent machine | numpy |
| 10 | process measurements: mean, median, mode, variance, std, stability | numpy, statistics |
The full question text of each is in its function docstring: yashdw.question(3).
Notes on the code: Q.4 uses the array exactly as the question lists it
([12,15,18,20,22,24,26,28,30,32]). Your original notebook was missing the 28.
Q.6 is random, so its numbers change on every run.
Usage
import yashdw
yashdw.q1() # plain function call - works everywhere
yashdw.1 # shortcut (see below)
yashdw.run(5) # same as q5()
yashdw.question(8) # print the question text
yashdw.show(8) # print the source code of solution 8
yashdw.insert(8) # put solution 8's code into a NEW editable cell
From a terminal (no Jupyter needed): python -m yashdw 3 or python -m yashdw all.
How the yashdw.1 shortcut works (and its limits)
yashdw.1is not valid Python: the tokenizer reads.1as a number, and names cannot start with a digit. A real attribute is impossible.- So
import yashdwregisters an IPython input transformer. Before a cell runs, it rewrites a line that is exactlyyashdw.1(1–10) intoyashdw.q1(). - It executes the solution. It does NOT insert code into your cell. The cell
keeps showing
yashdw.1, and the output appears below it. - To get editable code, use
yashdw.insert(1). It uses IPython'sset_next_inputto create a new cell below containing the code. That works in IPython and in Jupyter Notebook/JupyterLab, but I could not test it on your frontend. Writing into the same cell would need a Jupyter frontend extension, which this package does not include. - The shortcut only works when the line is by itself (
yashdw.1oryashdw.1;) in IPython/Jupyter. In plainpythonscripts or the standardpythonshell useyashdw.q1(). - If the shortcut is not active, run
%load_ext yashdworyashdw.enable_shortcut().
Installation
Requirements: Python 3.8+, numpy, pandas (and jupyter/ipython for notebooks).
Installing needs internet unless you prepared the wheels beforehand (next section).
Windows (Command Prompt / PowerShell)
cd path\to\yashdw_module
py -m pip install -r requirements.txt
py -m pip install .
Linux / macOS
cd path/to/yashdw_module
python3 -m pip install -r requirements.txt
python3 -m pip install .
Android / Termux
pkg update
pkg install python python-numpy python-pandas
pip install ipython notebook # Jupyter on Termux can be difficult; ipython alone is fine
cd yashdw_module && pip install .
Termux packages numpy/pandas through pkg; building them with pip is slow and often fails.
Jupyter Notebook on Termux can need extra build tools. ipython also supports yashdw.1.
Jupyter
Install into the same Python that runs Jupyter. From inside a notebook:
%pip install /full/path/to/yashdw_module
Then import yashdw.
Without installing at all
Put the yashdw/ folder next to your notebook (or add its parent to sys.path).
It only needs numpy and pandas to be installed already.
Offline use (prepare while online)
Offline works only for things already downloaded or installed.
- While online (the five-minute window), in the project folder:
Pip stores wheels for your OS and Python version only. Prepare on the same machine/Python you will use.python install.py --wheels # downloads numpy, pandas, etc. wheels into ./wheelhouse python install.py # installs everything now - Later, offline:
If the packages are already installed (step 1, second command), you need nothing more:python install.py --offline # installs from ./wheelhouse, no internet python install.py --check # runs all 10 solutionsimport yashdwworks offline.
Also prepare beforehand: confirm jupyter notebook starts, and run python install.py --check.
Optional: publishing to PyPI (not done)
This package has not been published. The ZIP works locally without PyPI. If you
ever want to publish: pip install build twine, python -m build, then
twine upload dist/* with your own PyPI account. The name yashdw may already be taken.
Files
yashdw/__init__.py shortcut, helpers, IPython transformer
yashdw/solutions.py q1() ... q10()
yashdw/__main__.py python -m yashdw N
install.py install / offline helper
examples/practical_examples.ipynb
Metadata
Release files for yashdw 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| yashdw-1.0.0.tar.gz | 9.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| yashdw-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.8 kB
Release files / yashdw-1.0.0.tar.gz
| Download URL | yashdw-1.0.0.tar.gz |
|---|---|
| Size | 9.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cae8c4aca151edf9730d091c15f173caa772ca4481c0991c0ae2f236105aa28c
|
|
BLAKE2b-256 checksum How to use checksums |
3e8b56e446401033ee8831fa949c3d7c8f39b6a5817cb6c34b287dcfd8dae6b3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.13
|
Release files / yashdw-1.0.0-py3-none-any.whl
| Download URL | yashdw-1.0.0-py3-none-any.whl |
|---|---|
| Size | 7.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7eabf87388fe4d67a23057600077710c9d15fd27b9a128caf19376d14ee07ed6
|
|
BLAKE2b-256 checksum How to use checksums |
db33301876eda88d6a97f1b10792481cbdd91d33ef52849732f3c1a9bc52a7be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.13
|
Security for yashdw 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.