我在 Julia 中有这个 for 循环:
begin
countries_data_labels = ["Canada", "Italy", "China", "United States", "Spain"]
y_axis = DataFrame()
for country in countries_data_labels
new_dataframe = get_country(df, country)
new_dataframe = DataFrame(new_dataframe)
df_rows, df_columns = size(new_dataframe)
new_dataframe_long = stack(new_dataframe, begin:end-4)
y_axis[!, Symbol("$country")] = new_dataframe_long[!, :value]
end
end
我收到了这个错误:
syntax: extra token ")" after end of expression
我决定注释除第一个循环之外的所有 for 循环主体,并在取消注释后每次运行单元格以查看哪一行引发了此错误,它是主体中的第 4 行:
new_dataframe_long = stack(new_dataframe, begin:end-4)
没有理由存在此错误。此行中没有额外的支架件。