I have data in string format like:
str1 = "[0,-1.5],[-12.5,1.5],[12.5,1.5],[12.5,-1.5],[-12.5,-1.5])"
I want to put this data into an excel file. means 1st value from the array will go in x Col and 2nd value will go in Y col. this will be repeated until the whole string will be added to the x and y columns. I am attempting like, first convert the string into dataframe and then dataframe to an excel file. but it's giving me an error of "Empty DataFrame".
bad_chars = [';', ':', '(', ')', '[', ']']
s = ""
for i in str1:
if i not in bad_chars:
s += i
print(s)
StringData = StringIO(s)
df = pd.read_csv(StringData, sep=",")
# Print the dataframe
print(df)

str1correctly specified? Does it have only one round bracket?