Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F61159044
test_interp_speed.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, May 4, 22:05
Size
318 B
Mime Type
text/x-python
Expires
Mon, May 6, 22:05 (2 d)
Engine
blob
Format
Raw Data
Handle
17473768
Attached To
R4670 PySONIC (old)
test_interp_speed.py
View Options
from
scipy.interpolate
import
interp1d
import
numpy
as
np
import
timeit
x
=
np
.
linspace
(
1
,
10000
,
5
)
f
=
lambda
x
:
x
**
2
y
=
f
(
x
)
xnew
=
1234
u
=
timeit
.
timeit
(
lambda
:
np
.
interp
(
xnew
,
x
,
y
))
print
(
u
)
u
=
timeit
.
timeit
(
lambda
:
interp1d
(
x
,
y
))
print
(
u
)
h
=
interp1d
(
x
,
y
)
u
=
timeit
.
timeit
(
lambda
:
h
(
xnew
))
print
(
u
)
Event Timeline
Log In to Comment