DataFrames #
- Select multiple columns:
select(df, Between(1, 3), Between(4, 6))
- Rename columns
colnames = ["why", "not"]
rename!(df, Symbol.(colnames))
- Delete a row (1st row in the following example)
delete!(df, 1)
- Delete a column (1st column in the following example)
select!(df, Not(1))
- Drop missing values in some but not all colomns
dropmissing(df, [:A, :B])
- Add a column by concatenating strings
df[:, :NewColname] = string.(df.first_col, " ", df.second_col)
Vector, Array #
- Initialize an empty vector of strings
t = String[];
push!(t, "Anything")
- Export an array to CSV
using DelimitedFilees
writedlm("FileName.csv", A, ',')
# A is the array
Last modified on 2022-01-31