-
Notifications
You must be signed in to change notification settings - Fork 172
Open
Description
Brief Description
enhance currency conversion using 'accounting' to support common excel negative currency strings like ($12.3)
I would like to propose...
Example API
uses existing currency conversion function when handling the 'accounting' format with the following code to handle currency strings - minor edit on existing code makes it more useful
outcome = (
df[column_name].astype(str)
.str.strip()
.str.replace("$", "", regex=False)
.str.replace(",", "", regex=False)
.str.replace(")", "", regex=False)
.str.replace("(", "-", regex=False)
.replace({"-": 0.0})
.astype(float)
)
return df.assign(**{column_name: outcome})
# ...
Metadata
Metadata
Assignees
Labels
No labels