mirror of
https://github.com/rasbt/python_reference.git
synced 2025-01-30 13:13:50 +00:00
row slice benchmark
This commit is contained in:
parent
43171df6ed
commit
c561c92eea
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"name": "",
|
"name": "",
|
||||||
"signature": "sha256:08918c81301f699d85bfad155946f6e0102ce07bb31796cb9bdda23ffb2e22a6"
|
"signature": "sha256:ab74fdc9e8ae58388d1fc428599abc86a3d03938d0f51769cef38ab4028d516a"
|
||||||
},
|
},
|
||||||
"nbformat": 3,
|
"nbformat": 3,
|
||||||
"nbformat_minor": 0,
|
"nbformat_minor": 0,
|
||||||
|
@ -1472,6 +1472,8 @@
|
||||||
"input": [
|
"input": [
|
||||||
"import numpy as np\n",
|
"import numpy as np\n",
|
||||||
"\n",
|
"\n",
|
||||||
|
"# 1st column, e.g., A[:,0,np.newaxis]\n",
|
||||||
|
"\n",
|
||||||
"def colvec_method1(A):\n",
|
"def colvec_method1(A):\n",
|
||||||
" for col in A.T:\n",
|
" for col in A.T:\n",
|
||||||
" colvec = row[:,np.newaxis]\n",
|
" colvec = row[:,np.newaxis]\n",
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"name": "",
|
"name": "",
|
||||||
"signature": "sha256:08918c81301f699d85bfad155946f6e0102ce07bb31796cb9bdda23ffb2e22a6"
|
"signature": "sha256:ab74fdc9e8ae58388d1fc428599abc86a3d03938d0f51769cef38ab4028d516a"
|
||||||
},
|
},
|
||||||
"nbformat": 3,
|
"nbformat": 3,
|
||||||
"nbformat_minor": 0,
|
"nbformat_minor": 0,
|
||||||
|
@ -1472,6 +1472,8 @@
|
||||||
"input": [
|
"input": [
|
||||||
"import numpy as np\n",
|
"import numpy as np\n",
|
||||||
"\n",
|
"\n",
|
||||||
|
"# 1st column, e.g., A[:,0,np.newaxis]\n",
|
||||||
|
"\n",
|
||||||
"def colvec_method1(A):\n",
|
"def colvec_method1(A):\n",
|
||||||
" for col in A.T:\n",
|
" for col in A.T:\n",
|
||||||
" colvec = row[:,np.newaxis]\n",
|
" colvec = row[:,np.newaxis]\n",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user