Skip to content

Instantly share code, notes, and snippets.

@aldro61
Last active February 15, 2020 19:35
Show Gist options
  • Save aldro61/c70fac1b4405be8c75ffdf3d274fa0b4 to your computer and use it in GitHub Desktop.
Save aldro61/c70fac1b4405be8c75ffdf3d274fa0b4 to your computer and use it in GitHub Desktop.
A bash function to generate a logspace
# Generate a logspace from numpy in bash
# Usage: logspace start end [count, default=10]
# Just source this file or add it to your .bashrc
logspace () {
start=$1
end=$2
if [ $# -ne 3 ]
then
count=10
else
count=$3
fi
python -c "import numpy as np; print(np.logspace($start, $end, $count).tolist())"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment