Thank you very much Milan !
When I searched a solution in DataFrame documentation I did not found the 
keyword "similar". Is there an equivalent for Julia of this website 
<http://perldoc.perl.org/index-functions-by-cat.html>for Perl for example ? 

julia> df = readtable("test2.tsv")
4x4 DataFrames.DataFrame
│ Row │ row1   │ x3_39 │ x2_5 │ x4_5 │
┝━━━━━┿━━━━━━━━┿━━━━━━━┿━━━━━━┿━━━━━━┥
│ 1   │ "row2" │ 3.46  │ 2.7  │ 4.8  │
│ 2   │ "row3" │ 3.58  │ 2.9  │ 4.7  │
│ 3   │ "row4" │ 3.7   │ 2.7  │ 4.9  │
│ 4   │ "row5" │ 3.81  │ 3.0  │ 5.3  │

julia> m = similar(df,0)
0x4 DataFrames.DataFrame


julia> m
0x4 DataFrames.DataFrame

julia> df[2,:]
1x4 DataFrames.DataFrame
│ Row │ row1   │ x3_39 │ x2_5 │ x4_5 │
┝━━━━━┿━━━━━━━━┿━━━━━━━┿━━━━━━┿━━━━━━┥
│ 1   │ "row3" │ 3.58  │ 2.9  │ 4.7  │

julia> append!(m, df[2,:])
1x4 DataFrames.DataFrame
│ Row │ row1   │ x3_39 │ x2_5 │ x4_5 │
┝━━━━━┿━━━━━━━━┿━━━━━━━┿━━━━━━┿━━━━━━┥
│ 1   │ "row3" │ 3.58  │ 2.9  │ 4.7  │

julia> m
1x4 DataFrames.DataFrame
│ Row │ row1   │ x3_39 │ x2_5 │ x4_5 │
┝━━━━━┿━━━━━━━━┿━━━━━━━┿━━━━━━┿━━━━━━┥
│ 1   │ "row3" │ 3.58  │ 2.9  │ 4.7  │



Reply via email to