Closed freshduer closed 2 years ago
the empty() uses the n_rows() ,but n_rows() returns the number of rows that have been read so far,which is totally not right for the empty func.
i suppose this should be modified , turn the n_rows() into some else
empty() = "Whether or not the file or stream contains valid CSV rows".
If there is a valid CSV row, n_rows => 1 (see pic). Because empty() returns n_rows, empty() >= 1 if there is a valid CSV row.
Therefore empty() does what it's supposed to. QED.
maybe u can try to use csv reader to load a csvfile and then use empty() function to see whether the return value is 0 or not it appears to me that the result is always 0 ----n_rows() returns the number of rows that have been read so far,but if you do not use the read_row() function,the _n_rows is always 0
empty() = "Whether or not the file or stream contains valid CSV rows".
If there is a valid CSV row, n_rows => 1 (see pic). Because empty() returns n_rows, empty() >= 1 if there is a valid CSV row.
Therefore empty() does what it's supposed to. QED.
maybe u can try to use csv reader to load a csvfile and then use empty() function to see whether the return value is 0 or not it appears to me that the result is always 0 ----n_rows() returns the number of rows that have been read so far,but if you do not use the read_row() function,the _n_rows is always 0
@vincentlaucsb maybe u can try to use csv reader to load a csvfile and then use empty() function to see whether the return value is 0 or not it appears to me that the result is always 0 ----n_rows() returns the number of rows that have been read so far,but if you do not use the read_row() function,the _n_rows is always 0