Question
The goal is to find a simple way for converting a set of data to a string.
Maybe I am too newby but I found nothing about conversion from a set to string. A similar question (Numpy converting array from float to strings) did not help me a lot.
Example
The code I wrote seems definitely not ideal:
DataSet = {(1,4): 272.3,
(2,4): 274.74}
print(', '.join(np.array(DataSet).astype('str'))))
Personal goal
In the end I want to create a string like:
DataSet = {(1,4): 272.3,
(2,4): 274.74}
version = 2.7
print(''.join(np.array(['The data in {',
', '.join(np.array(DataSet).astype('str'))),
'} is calculated with python%3.1f.' % version]))
The output should look like (it would be nice but not necessary to implement some fixed float precision):
'The data in {272.3, 274.7} is calculated with python2.7.'