Skip to content

Instantly share code, notes, and snippets.

@jtemporal
Created August 8, 2017 17:11
Show Gist options
  • Save jtemporal/e071f71ab6e282bcce369d366aa4e935 to your computer and use it in GitHub Desktop.
Save jtemporal/e071f71ab6e282bcce369d366aa4e935 to your computer and use it in GitHub Desktop.
error running Rosie toolbox v12.0.4
$ python rosie.py run chamber_of_deputies
/Users/temporal/src/dsbr/serenata/rosie/rosie/chamber_of_deputies/adapter.py:25: DtypeWarning: Columns (10) have mixed types. Specify dtype option on import or set low_memory=False.
self.update_datasets()
Merging all datasets…
Loading reimbursements-2009.xz…
Loading reimbursements-2010.xz…
Loading reimbursements-2011.xz…
Loading reimbursements-2012.xz…
Loading reimbursements-2013.xz…
Loading reimbursements-2014.xz…
Loading reimbursements-2015.xz…
Loading reimbursements-2016.xz…
Loading reimbursements-2017.xz…
Dropping rows without document_value or reimbursement_number…
Grouping dataset by applicant_id, document_id and year…
Gathering all reimbursement numbers together…
Summing all net values together…
Summing all reimbursement values together…
Generating the new dataset…
Casting changes to a new DataFrame…
Writing it to file…
Done.
Downloading 2016-09-03-companies.xz: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4.84M/4.84M [00:06<00:00, 753Kb/s]
Traceback (most recent call last):
File "rosie.py", line 60, in <module>
command()
File "rosie.py", line 34, in run
klass.main(target_directory)
File "/Users/temporal/src/dsbr/serenata/rosie/rosie/chamber_of_deputies/__init__.py", line 8, in main
core = Core(settings, adapter)
File "/Users/temporal/src/dsbr/serenata/rosie/rosie/core/__init__.py", line 30, in __init__
self.dataset = adapter.dataset
File "/Users/temporal/src/dsbr/serenata/rosie/rosie/chamber_of_deputies/adapter.py", line 32, in dataset
self.prepare_dataset()
File "/Users/temporal/src/dsbr/serenata/rosie/rosie/chamber_of_deputies/adapter.py", line 37, in prepare_dataset
self.rename_categories()
File "/Users/temporal/src/dsbr/serenata/rosie/rosie/chamber_of_deputies/adapter.py", line 50, in rename_categories
types, inplace=True)
File "/Users/temporal/anaconda3/envs/serenata_rosie/lib/python3.6/site-packages/pandas/core/base.py", line 211, in f
return self._delegate_method(name, *args, **kwargs)
File "/Users/temporal/anaconda3/envs/serenata_rosie/lib/python3.6/site-packages/pandas/core/categorical.py", line 2085, in _delegate_method
res = method(*args, **kwargs)
File "/Users/temporal/anaconda3/envs/serenata_rosie/lib/python3.6/site-packages/pandas/core/categorical.py", line 807, in rename_categories
cat.categories = new_categories
File "/Users/temporal/anaconda3/envs/serenata_rosie/lib/python3.6/site-packages/pandas/core/categorical.py", line 595, in _set_categories
raise ValueError("new categories need to have the same number of "
ValueError: new categories need to have the same number of items than the old categories!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment