import numpy as np import pandas as pd import numpy as np import numpy

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import numpy as np
import pandas as pd
import numpy as np
import numpy
import sys
import os
#numpy.set_printoptions(threshold=sys.maxsixe)
def ttime(x,y,z,p):
spt=2*x*((np.sqrt((1/z**2)-(p**2)))-(np.sqrt((1/y**2)-(p**2))))
sppt=2*x*((np.sqrt((1/z**2)-(p**2)))+(np.sqrt((1/y**2)-(p**2))))
pmpt=2*x*(np.sqrt((1/y**2)-(p**2)))
return (spt,sppt,pmpt)
x=np.loadtxt('xrpt.txt')
y=np.loadtxt('yrpt.txt')
z=np.loadtxt('zrpt.txt')
p=np.loadtxt('slowrpt.txt')
print(x,y,z,p)
ttime(x,y,z,p)
def fun(): return [np.random.rand(1,3) for _ in range(5)]
res = ttime(x,y,z,p) # 5 arrays which are returned by python function
merged = np.concatenate(res, axis=0).reshape(8000,3)
df = pd.DataFrame(data=merged,columns=[f'a{i}' for i in range(3)])
df.to_csv("test.csv")