/ df2string.jl
df2string.jl
1 using DataFrames 2 3 """ 4 df2string(DataFrame) 5 6 Convert the data type of all columns in the DataFrame to **String**. 7 8 This function depends on these packages: 9 - DataFrames 10 11 The input argument must be a **DataFrame**. 12 13 # Examples 14 ```julia-repl 15 julia> dfStringType = df2string(df) 16 [ Info: Converting contents of Dataframe to String data type... 17 110×9 DataFrame 18 . 19 . 20 . 21 22 ``` 23 """ 24 function df2string(df::DataFrame) 25 @info "Converting contents of Dataframe to String data type..." 26 mapcols!(col -> string.(col), df) 27 return df 28 end