outs1der / minbar

Tools and software for building, accessing and analysing the Multi-INstrument Burst ARchive (MINBAR)
GNU General Public License v3.0
8 stars 0 forks source link

pandas implementation no longer works #8

Open outs1der opened 4 years ago

outs1der commented 4 years ago

Here's the old text from README.md with suggested usage:

pandas

pandas is a data analysis library with many features. The Minbar databases can be loaded as pandas DataFrames:

#!python

import minbar.to_pandas
mb = minbar.to_pandas.load_bursts() # Create a DataFrame with burst data
mo = minbar.to_pandas.load_observations()
ms = minbar.to_pandas.load_sources()
df = mb.get_source('1636') # Select a source using part of its name
df = mb.get_instrument('pca') # Select an instrument ('pca', 'wfc', or 'jemx')
yveskini commented 1 year ago

I got around the pandas' issue by first installing pandas in the conda environment, and then I proceeded to install minbar and other required packages.

outs1der commented 1 year ago

No this is just an issue with the to_pandas method, which throws an error:

>>> mb = minbar.to_pandas.load_bursts()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/Shared/burst/minbar/pyminbar/minbar/to_pandas.py", line 79, in load_bursts
    return _minbar2pandas()
  File "/Users/Shared/burst/minbar/pyminbar/minbar/to_pandas.py", line 70, in _minbar2pandas
    data = data.byteswap().newbyteorder('N') # Switch to native byteorder for pandas
AttributeError: 'Table' object has no attribute 'byteswap'

It should be possible to use pandas fine in other contexts