Installing a new python version
I get errors after a new pyenv install X
that I don’t get on versions I’ve been using awhile (e.g. 3.9.15
). This section is attempting to collect all the commands I ran over time to make new versions work.
- Confirm new version is active with
pyenv version
- If not, activate new version with
pyenv local X
orpyenv global X
- Solve
clang
error…how? - Run
pip install -U 'roadie[cli]'
Set up a new Python project on my laptop
- Confirm desired
pyenv
version is active withpyenv version
- Confirm
roadie
is installed and up-to-date withpip install -U 'roadie[cli]'
- Create venv by running
roadie venv
- or run my
rv
alias (which runspip install -U 'roadie[cli]' && roadie venv
, which creates newpyenv shell
case) - It’s safe to delete a project’s
venv
folder(s) + rerun the above steps anytime (e.g. if dependency-related issues come up and seem difficult to debug). - The
rv
alias is safe to rerun anytime.
- Update my
venv
,edit
andrun
aliases to include cases for this project
Links:
- Developing Python at Recursion • recursionpharma/rxrx-python
Updating Python dependencies
- Update the lock file by running
roadie lock
orroadie lock -c
to update everything
Pandas DataFrames
- Series = entire column
- you can modify an entire column at once with a single expression (e.g.
line 63
ofphenoapp/plots/heatmap/__init__.py
):plot_value = plotdf.distance * COLOR_DARKENING_FACTOR
— this multiplies every cell in the “distance” column by the darkening factor and returns the modified series (kind of like anArray.map
)
- you can modify an entire column at once with a single expression (e.g.
Inbox