数据框在 excel 文件中的空行之前被剪切
Dataframe gets cut before an empty row in an excelfile
我有一个 excel 文件,它有 79 行和 12 列。
我遇到的问题是,当我 运行 以下代码时,我只得到 8 行和 1 列。
第 9 行是空行,我认为这是问题所在。但我不知道如何解决这个问题。我尝试过以不同的方式使用 missing
、ismissing
、allowmissing
和 dropmissing
。但是我尝试过的任何东西都不适合我。
using DataFrames, XLSX
df = DataFrame(XLSX.readtable("file.xlsx")...)
println(df)
空行是否有问题,我该如何处理该空行?或者是否有其他原因可能导致我只能得到 8 行和 1 列的问题?
stop_in_empty_row
is a boolean indicating wether an empty row marks the end of the
table. If stop_in_empty_row=false
, the TableRowIterator will continue to fetch rows
until there's no more rows in the Worksheet. The default behavior is stop_in_empty_row=true
.
因此将 stop_in_empty_row=false
设置为在空行中读取为 missing
我有一个 excel 文件,它有 79 行和 12 列。
我遇到的问题是,当我 运行 以下代码时,我只得到 8 行和 1 列。
第 9 行是空行,我认为这是问题所在。但我不知道如何解决这个问题。我尝试过以不同的方式使用 missing
、ismissing
、allowmissing
和 dropmissing
。但是我尝试过的任何东西都不适合我。
using DataFrames, XLSX
df = DataFrame(XLSX.readtable("file.xlsx")...)
println(df)
空行是否有问题,我该如何处理该空行?或者是否有其他原因可能导致我只能得到 8 行和 1 列的问题?
stop_in_empty_row
is a boolean indicating wether an empty row marks the end of the table. Ifstop_in_empty_row=false
, the TableRowIterator will continue to fetch rows until there's no more rows in the Worksheet. The default behavior isstop_in_empty_row=true
.
因此将 stop_in_empty_row=false
设置为在空行中读取为 missing