x = x[::-1]
y = y[::-1]
然后内插值就可以正常工作了。
这里物理与非物理都有……
x = x[::-1]
y = y[::-1]
List, dictionary, set, tuple etc. are all objects (classes) in python. When copying an object in python, the default way is to do a "shallow copy".
Basically x=y just copy the reference (or pointer if you are more familiar with C) of x to y, so now they point to the same address in your memory. Thus change one will automatically change the other.If you want a "deep copy" (a separate copy with a different memory address) for a list, you can do x=list(y). There is also a package called copy, with a function called deepcopy, so x=copy.deepcopy(y) should do the same.On the other hand, the difference of "shallow copy" and "deep copy" only exists for objects. If you are copying an integer, string, boolean etc. It can only create a deep copy.
a=0这段代码将陷入死循环,输出如下:
b=6
while b!=a:
a=b
print a
b=b-1
print a
6
6
5
5
4
4
...
a=[0]这段代码在第一个循环结束就停了,输出如下:
b=[6]
while b!=a:
a=b
print a
b[0]=b[0]-1
print a
[6]
[5]
a=[0,1]
b=[0,1]
# a==b: TRUE
# a is b: FALSE
如果把源代码改成:where we define$$P_{th}(T_m)=a(T_m-T_0)+c(T_m^2-T_0^2) \eqno{(5)}$$
where we define(中间空一行)
$$P_{th}(T_m)=a(T_m-T_0)+c(T_m^2-T_0^2) \eqno{(5)}$$
本作品采用
知识共享署名-非商业性使用-相同方式共享 2.5 中国大陆许可协议进行许可。