2

I have a xarray.DataArray:

array([  5.437614e+01,   2.090367e+02,   3.687384e+02, ...,   5.121467e-02,
         5.116013e-02,   5.110552e-02])
Coordinates:
  * time     (time) datetime64[ns] 1999-12-01 2010-06-01T06:00:00 ...

I found several answers for lists, but I am not able to do it for an array.

Tried

a1.pop[0]

AttributeError: 'DataArray' object has no attribute 'pop'
Felix Kling
  • 795,719
  • 175
  • 1,089
  • 1,143
maximusdooku
  • 5,242
  • 10
  • 54
  • 94

2 Answers2

2

try a1 = a1[1:] because that should work perfectly

developer_hatch
  • 15,898
  • 3
  • 42
  • 75
0

Try other brackets (the round ones):

a1.pop(0)

Edit: I found the second answer very useful, but it's about list since there are no arrays in Python?

Remove object from a list of objects in python