Using the following function:
def exportExcel(data):
df = pd.DataFrame(data)
filepath = 'Output.xlsx'
df.to_excel(filepath, index=False)
Output after exporting the np.array to excel columns
column a column b column c
[[0.00536237] [0.00536237]] [0.01030928]
[[0.00652899] [0.00652899]] [0.]
[[0.00579218] [0.00579218]] [0.]
How can I remove all the squared brackets?
I have tried several solutions, but they don´t work:
for col in df:
df[col] = df[col].str.extract(r'\[(.*)\]')
Thank you
type(df['column a'].iloc[0])? It's important to know whether you have strings, a list, an array, or something else.