You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
but it does not work as intended.
When casting the DataFrame to str, all nan values will be replaced with the string "nan" and fillna does nothing anymore.
see:
Though, I do not know the best way to handle the intended conversion. One way could be to just change the order, first do fillna and later cast to string. But I don't know what happens if fillna('', inplace=True) is thrown against dtypes incompatible with / other than a string.
best
The text was updated successfully, but these errors were encountered:
mrckzgl
changed the title
Normalization of NaN
Normalization of NaN is not working as intended
Jul 8, 2024
I also wonder if it is necessary and good practice to convert the dataframe to string, as then there is no distinction between na and empty string anymore ...
Yeah you're right on your remarks. Indeed NaN handling has no effect this way. So changing rows I think will do the trick.
# Fill NaN values with empty string
self.dataset_1.fillna("", inplace=True)
self.dataset_1 = self.dataset_1.astype(str)
if not self.is_dirty_er:
self.dataset_2.fillna("", inplace=True)
self.dataset_2 = self.dataset_2.astype(str)
As far as the str transformation, it is necessary in order to assure that no other types will be handled. It caused issues in many other steps, and that's why we decided to handle it this way.
The above fix will be uploaded in the next release.
The data class tries to normalize na / nan values into empty strings.
This is done here:
pyJedAI/src/pyjedai/datamodel.py
Lines 126 to 130 in a668c98
but it does not work as intended.
When casting the DataFrame to str, all nan values will be replaced with the string "nan" and fillna does nothing anymore.
see:
Though, I do not know the best way to handle the intended conversion. One way could be to just change the order, first do fillna and later cast to string. But I don't know what happens if fillna('', inplace=True) is thrown against dtypes incompatible with / other than a string.
best
The text was updated successfully, but these errors were encountered: