Skip to content

TNS: 'DataFrame' object has no attribute 'burst_bandwidth' #16

@InesPM

Description

@InesPM

When running the following command (where user and id are my personal TNS login details):
tns = TNS(tns_name="user", tns_id="id", repeaters=False)
I get the following Attribute error:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-5-e98b701f8d56> in <module>
----> 1 tns = TNS(tns_name="MyName", tns_id="MyID", repeaters=False)

/opt/anaconda3/lib/python3.9/site-packages/frbcat/tns.py in __init__(self, oneoffs, repeaters, repeat_bursts, update, path, save, mute, tns_id, tns_name)
     52         self.tns_name = tns_name
     53 
---> 54         self.get_data()
     55         self.filter(one_offs=self.oneoffs,
     56                     repeaters=self.repeaters,

/opt/anaconda3/lib/python3.9/site-packages/frbcat/tns.py in get_data(self)
    125                 entries = self.get_json()
    126                 df = self.json2df(entries)
--> 127                 self.clean_df(df)
    128 
    129                 if self.save:

/opt/anaconda3/lib/python3.9/site-packages/frbcat/tns.py in clean_df(self, df)
    365             df[c + '_err'] = err.astype(float)
    366 
--> 367         cols = df.burst_bandwidth.str.strip(' MHz').str.partition(' (')[[0, 2]]
    368         df['burst_bandwidth'] = cols[0].astype(float)
    369         err = cols[2].str.strip(')')

/opt/anaconda3/lib/python3.9/site-packages/pandas/core/generic.py in __getattr__(self, name)
   5573         ):
   5574             return self[name]
-> 5575         return object.__getattribute__(self, name)
   5576 
   5577     def __setattr__(self, name: str, value) -> None:

AttributeError: 'DataFrame' object has no attribute 'burst_bandwidth'

Could it be that I have an uncompatible pandas version? I currently have version 1.4.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions