Describe the bug
I think we want to be able to load a CSVOutput saved csv file in PYMEVis, but at the moment at least on my version of pandas, there is an extra row of each localization's index, and that row has no name.
<PYME.recipes.localisations.ProcessColour object at 0x12040c090>
ERROR:PYME.recipes.recipe:Error in recipe module: <PYME.recipes.localisations.ProcessColour object at 0x12040c090>
Traceback (most recent call last):
File "/Users/andy/code/python-microscopy/PYME/recipes/recipe.py", line 238, in execute
m.execute(self.namespace)
File "/Users/andy/code/python-microscopy/PYME/recipes/base.py", line 336, in execute
ret = self.run(**inputs)
^^^^^^^^^^^^^^^^^^
File "/Users/andy/code/python-microscopy/PYME/recipes/localisations.py", line 430, in run
cached_output = tabular.CachingResultsFilter(output)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/andy/code/python-microscopy/PYME/IO/tabular.py", line 985, in __init__
self.Index = np.ones(len(self.resultsSource), dtype=bool)
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/andy/code/python-microscopy/PYME/IO/tabular.py", line 202, in __len__
return len(self[list(self.keys())[0]])
~~~~^^^^^^^^^^^^^^^^^^^^^^
File "/Users/andy/code/python-microscopy/PYME/IO/tabular.py", line 1066, in __getitem__
return self.resultsSource[keys]
~~~~~~~~~~~~~~~~~~^^^^^^
File "/Users/andy/code/python-microscopy/PYME/IO/tabular.py", line 1066, in __getitem__
return self.resultsSource[keys]
~~~~~~~~~~~~~~~~~~^^^^^^
File "/Users/andy/code/python-microscopy/PYME/IO/tabular.py", line 658, in __getitem__
return self.res[key][sl]
~~~~~~~~^^^^^
ValueError: no field of name
To Reproduce
Steps to reproduce the behavior:
- PYMEVis open some localizations
- Use the recipes tab to add a CSVOutput and save the locs to csv
- PYMEVis that csv file
- See error
Expected behavior
Open the CSV files we save
Platform (please complete the following information - or copy-paste from error dialog if shown):
Additional context
One fix is to save with the index=False flag:
v.to_csv(out_filename, index=False)
But maybe we would rather handle files with a no name index column on load?
Describe the bug
I think we want to be able to load a CSVOutput saved csv file in PYMEVis, but at the moment at least on my version of pandas, there is an extra row of each localization's index, and that row has no name.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Open the CSV files we save
Platform (please complete the following information - or copy-paste from error dialog if shown):
Additional context
One fix is to save with the index=False flag:
v.to_csv(out_filename, index=False)But maybe we would rather handle files with a no name index column on load?