code: def test_to_returns_df(df):
      data = df
      actual = data.to_returns()
  
      assert len(actual) == len(data)
      assert all(np.isnan(actual.iloc[0]))
      aae(actual["AAPL"][1], -0.019, 3)
      aae(actual["AAPL"][9], -0.022, 3)
      aae(actual["MSFT"][1], -0.011, 3)
      aae(actual["MSFT"][9], -0.014, 3)
      aae(actual["C"][1], -0.012, 3)
      aae(actual["C"][9], 0.004, 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 5 for calling a global function with example usage: test_to_returns_df(df) without return types