Dictionaries to compare to:
PositiveKey = {"{":"0", "A":"1", "B":"2"}
NegativeKey = {"}":"0", "J":"1", "K":"2"}
Current DataFrame:
Column 1
0 000000002758A
1 000000326588B
2 000000000567J
Desired DataFrame:
Column 1
0 275.81
1 32658.82
2 -56.71
I am trying to find a way to check if the last character within a data point of a specific DF column matches against two dictionaries (categorized as needing a status as positive or negative). Depending on which dictionary key the last character of the data point matches with:
- I need the data point to be updated with the corresponding value and the overall data point to be defined as a positive or negative integer. (IE line 0 should be "27581" and line 2 should be "-5671")
- I also need the data points to be updated to move the decimal place two spots left. (IE line 0 should be "275.81" and line 2 should be "-56.71").
I suppose converting the data points to integers and then multiplying by +/- .01 or dividing by +/- 100 could work here? Any input is appreciated, thank you!