probstj / ccGains

Python package for calculating cryptocurrency trading profits and creating capital gains reports
GNU Lesser General Public License v3.0
49 stars 13 forks source link

ValueError: Use `.rename` to alter labels with a mapper #28

Open obstler42 opened 5 years ago

obstler42 commented 5 years ago

Trying to get that working on Ubuntu 18, and when running the example.py, the following errors occur:

Traceback (most recent call last): File "example.py", line 392, in main() File "example.py", line 252, in main log_bags(bf) File "example.py", line 387, in log_bags ' ' + '\n '.join(str(bags).split('\n'))) File "/home/t/.local/lib/python3.6/site-packages/ccgains/bags.py", line 388, in str return self.to_data_frame().to_string( File "/home/t/.local/lib/python3.6/site-packages/ccgains/bags.py", line 385, in to_data_frame axis='columns') File "/home/t/.local/lib/python3.6/site-packages/pandas/util/_decorators.py", line 221, in wrapper return func(*args, **kwargs) File "/home/t/.local/lib/python3.6/site-packages/pandas/core/generic.py", line 1329, in rename_axis raise ValueError("Use .rename to alter labels " "with a mapper.") ValueError: Use .rename to alter labels with a mapper.

Any ideas on how to fix this? thanks!

obstler42 commented 5 years ago

Let me add the fixes here:

.rename_axes has to be changed to .rename in bags.y

.reindex_axis has to be changed to .reindex in reports.py