Closed xkungfu closed 2 years ago
get_data_by_idx()
is not suitable for your purpose. See docs for how to use it
In case of get_data_by_loc ()
also see docs and code samples. It is implemented to have Python-like indexing behavior. But, you can not just specify one value for Index2D
-- see docs.
Yes, -1 should point to the last element. If you see the docs for get_data_by_loc ()
, I have a code sample for that. Let me know if you see a bug.
according to the doc, I saw the last row is not in range -1. did I miss something?
MyDataFrame df4 = df.get_data_by_loc<double>(Index2D<long> { -4, -1 });
the output of df4 is:
df4:
INDEX:3:<ulong>:123450,123455,123450,
col_1:3:<double>:4,5,6,
col_2:3:<double>:11,12,13,
col_3:3:<double>:18,19,20,
col_4:3:<double>:25,nan,nan,
but the last row data is: "123449 7 14 21 nan", the data is not in df4.
does the row we talk about is the same row about the last row?
I will take a look
I found the problem. I will fix it over the weekend
OK, thank you!
@xkungfu , the fix is released to master
in pandas , df.iloc[-1] will get the last row. when I use get_data_by_idx, the range can't be set to negative. and when use get_data_by_loc {-1}, the application throw error: DataFrame::get_data_by_loc(): ERROR: Bad begin, end range: 64, 0 and when use get_data_by_loc {-10, -1} , the last row not in result.
so, can you set "-1" to last row?