Skip to content

Bug in mapdamagegeomparam script: AttributeError: 'DataFrame' object has no attribute 'ix' #1

@jfy133

Description

@jfy133

Bug

I was trying out tapas and came across the following bug, when running the following I would get the error:

❯ $TAPAS/mapdamagegeomparam --fit-plots fig/fit.png input/mapdamage/misincorporation.txt
Traceback (most recent call last):
  File "/raven/u/jfellowsy/bin/tapas-1.2/scripts/src/mapdamage2geomparam.py", line 436, in <module>
    if __name__=="__main__": main()
  File "/raven/u/jfellowsy/bin/tapas-1.2/scripts/src/mapdamage2geomparam.py", line 68, in main
    A = A.ix[A.Total != 0,:]
  File "/u/jfellowsy/conda-envs/tapas/lib/python3.9/site-packages/pandas/core/generic.py", line 5465, in __getattr__
    return object.__getattribute__(self, name)
AttributeError: 'DataFrame' object has no attribute 'ix'

This is derived from this line:

A = A.ix[A.Total != 0,:]

Where the ix column doesn't exist in the input mapDamage2 misincorporation file.

Workaround

Delete the referred to line in the above script, that refers to ix (assuming your misincorporation file doesn't have any 0s).

I was then successfully able to get the script ot run prpoerly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions