I would like to remove the single quotes from a list
Creating loop:
results = []
for k in range(1,number_of_observation+2):
results += ['X'+str(k)]
results
Output :
['X1','X2','X3','X4','X5','X6','X7','X8','X9','X10','X11','X12','X13','X14','X15','X16','X17','X18']
Actually each element in the list contains numpy array like this :
X1 = array([ 5.29869582e+03, 4.78138124e+03, 4.66993519e+03, 4.63760715e+03,
4.24625776e+03, 6.82121026e-13, 3.67310328e+03, 3.62922983e+03,
4.67551867e+03, -2.01596513e+03, 5.17998388e+03, 0.00000000e+00,
5.44605355e+03, 4.51697631e+03, 4.62300856e+03, 4.44902873e+03])
X2 = array([ 5.15984732e+03, 3.69964719e+03, 4.88607026e+03, 5.06762424e+03,
4.54623661e+03, 9.09494702e-13, 4.04998815e+03, 3.91555776e+03,
5.07698709e+03, -1.11066480e+03, 4.49209767e+03, 4.54747351e-13,
4.97724688e+03, 4.24955479e+03, 4.72048717e+03, 5.58904656e+03])
And i want to create dataframe from it
Final = pd.DataFrame(data = [results], columns= column_name)
Final
Desire output :
But it gave me output like this :
question from:
https://stackoverflow.com/questions/65866984/how-to-remove-single-quote-in-python-list