Skip to content
Snippets Groups Projects
Commit 2277b703 authored by Wachter, Christoph's avatar Wachter, Christoph
Browse files

(CW) pandas related bugfix for some read and write functionality

parent 93974afb
No related branches found
No related tags found
No related merge requests found
...@@ -317,7 +317,8 @@ def writeConfigurationsAndPropertiesToFile( ...@@ -317,7 +317,8 @@ def writeConfigurationsAndPropertiesToFile(
# When tuples are converted to string, whitespaces are automatically inserted between elements # When tuples are converted to string, whitespaces are automatically inserted between elements
# -> remove them before writing # -> remove them before writing
df[CONFIGS_KEY] = df[CONFIGS_KEY].map(str).str.replace(' ', '') # CW <15.10.2024> commented line as tuples do not need to be converted to string anymore
#df[CONFIGS_KEY] = df[CONFIGS_KEY].map(str).str.replace(' ', '')
df.to_csv(filename, df.to_csv(filename,
sep=delimiter, sep=delimiter,
...@@ -364,7 +365,9 @@ def readConfigurationsAndPropertiesFromFile(filename, delimiter=';', get_comment ...@@ -364,7 +365,9 @@ def readConfigurationsAndPropertiesFromFile(filename, delimiter=';', get_comment
# this conversion from strings to tuples takes most of the time # this conversion from strings to tuples takes most of the time
# but it's hard to optimize since the tuple has no fixed length # but it's hard to optimize since the tuple has no fixed length
configs_set = df[headers[0]].apply(get_tuple_from_string, convert_dtype=tuple).tolist() # CW <15.10.2024> removed "convert_dtype" to be compatible with future pandas versions
# try updating pandas if you're having issues
configs_set = df[headers[0]].apply(get_tuple_from_string).to_list()
# get properties if they exist # get properties if they exist
property_set = None property_set = None
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment