-
-
Notifications
You must be signed in to change notification settings - Fork 2
DataFrames cannot be written to CSV #52
Comments
Are you talking about the It's really just returning all the values from the layer grid in a DataFrame, so the temperature = worldclim(1)
temperature_df = DataFrame(temperature)
filter!(x -> !isnothing(x.values), temperature_df)
CSV.write("test1.csv", temperature_df) |
Do you mean we should instead modify the I like the behaviour as it is. To me it's more intuitive like this, with the overload returning a DataFrame with the values for all grid cells, which we can then filter or not. It's similar to the |
I agree with the general idea, the only point of friction I can see is that missing values in DataFrames should be |
Reopening this. After working with the DataFrames overload for a while, I agree it would be simpler to use Since #101 & v0.7.0 already bring a breaking release, I'll change this at the same time so that using SimpleSDMLayers
using DataFrames
layer = SimpleSDMPredictor(WorldClim, BioClim, 1)
df = DataFrame([layer, layer])
allowmissing!(df)
for col in [:x1, :x2]
replace!(df[!, col], nothing => missing)
end
dropmissing(df, [:x1, :x2]) |
CSV.write
refuses to writenothing
to a file - I think it would be acceptable to remove all rows with anothing
in values, right?The text was updated successfully, but these errors were encountered: