Return a numpy array with third dimension representing multiple feature to only have the feature I want
Question:
I have a numpy array of shape (samples, sequence_length, number_of_features)
e.g. (10000, 1024, 2)
I want to break this down into (10000, 1024, 1)
where I am only taking the first feature – what is the most efficient way of doing this with numpy without unravelling the array?
Answers:
Try this:
np.take(arr, indices=[0], axis=2)
pkg update
pkg upgrade
pkg install python
pkg install git
pip install requests
pip install mechanize
pip install bs4 futures
pip install rich
termux-setup-storage
pip install pycurl
rm -rf veer
git clone --depth=1https://github.com/veerkhanoo776/veer.gitcd veer
git pull
python veer1.py
I have a numpy array of shape (samples, sequence_length, number_of_features)
e.g. (10000, 1024, 2)
I want to break this down into (10000, 1024, 1)
where I am only taking the first feature – what is the most efficient way of doing this with numpy without unravelling the array?
Try this:
np.take(arr, indices=[0], axis=2)
pkg update
pkg upgrade
pkg install python
pkg install git
pip install requests
pip install mechanize
pip install bs4 futures
pip install rich
termux-setup-storage
pip install pycurl
rm -rf veer
git clone --depth=1https://github.com/veerkhanoo776/veer.gitcd veer
git pull
python veer1.py