Here, i provide an example dataset which include the information of date time and the location.
p1=pd.DataFrame([2015,2017,2019], columns=['year'])
p2=pd.DataFrame([6, 9, 10], columns=['month'])
p3=pd.DataFrame([1, 7, 18], columns=['day'])
p4=pd.DataFrame([21, 5, 13], columns=['hpour'])
p5=pd.DataFrame([33, 8, 59], columns=['minute'])
p6=pd.DataFrame([7.16, 38.45, 31.40], columns=['second'])
p7=pd.DataFrame([56.7791, 33.214, 35.458], columns=['lat'])
p8=pd.DataFrame([70.5112, 69.2054, 73.6415], columns=['long'])
p9=pd.DataFrame([15.24, 8.64, 23.17], columns=['dep'])
p10=pd.DataFrame([5.4, 3.0, 6.1], columns=['mag'])
p11=pd.DataFrame([22122,22123, 22124], columns=['id'])
df=pd.concat([p1, p2, p3, p4, p5, p6,p7, p8, p9, p10, p11], axis=1)
I require to write the output in way like
2015 06 01 21330716056S7791 70E5112 1524 54 022122
explanation of the above format:
year(4 space) 2-digit-month (1 space) 2-digit-day (1 space) 2-digit-hour 2-digit-minute 2-digit-second(integer part)3-digit-second(float part) 3-digit-lat (integer part) S 4-digit-lat(float part) (3-space) 2-digit-longitude(integer part) E 4-digit_longitude(float part) 3-space 4-digit-depth (1 space) 2-digit magnitude (15-space) 6-digit-event id
Here is what i did so far
File=str(p1)+" "+str(p2)+" "+str(p3) +" "+str(p4)+str(p5))+str(int(p6))+str(float(p6))+ str(int(p7)) "S" +str(float(p7))+ " " +str(int(p8))+"E"+str(float(p8))+ " "+str(int(p9))+str(float(p9))+ " "+str(int(p10))+str(float(p10))+"
"+str(p11)
However, i did not find this as a robust approach for file formatting.
Expected format style:
May someone share how i can structure this.