code: def test_to_returns_ts(ts):
      data = ts
      actual = data.to_returns()
  
      assert len(actual) == len(data)
      assert np.isnan(actual[0])
      aae(actual[1], -0.019, 3)
      aae(actual[9], -0.022, 3)
  
imports: import ffn
  import pandas
  import numpy
  from pytest import fixture
  from numpy.testing import assert_almost_equal
label_desc: Use image node_id 4 for calling a global function with example usage: test_to_returns_ts(ts) without return types