SciRuby / daru

Data Analysis in RUby
BSD 2-Clause "Simplified" License
1.04k stars 139 forks source link

Preserve keys order, when initialized by hash #407

Closed zverok closed 7 years ago

zverok commented 7 years ago
Daru::DataFrame.new({
  Routes:   [
        'Repo forks and issue count',
        'Popular repo of SciRuby',
        'Indian election data'
    ],
  Desc:     [
        'Analysis of fork and issue count present in sciruby org',
        'Popular SciRuby repo in the point of view of number of watchers',
        'Plotting a small dataset of obtained election results'
    ],
  Link: [
        "<a href='./sciruby/repos' target='_blank'>sciruby/repos</a>",
        "<a href='./sciruby/watchers' target='_blank'>sciruby/watchers</a>",
        "<a href='./election/data' target='_blank'>election/data</a>"
    ]
}, order: [:Routes, :Desc, :Link])
# => #<Daru::DataFrame(3x3)>
#                Routes       Desc       Link
#          0 Repo forks Analysis o <a href='.
#          1 Popular re Popular Sc <a href='.
#          2 Indian ele Plotting a <a href='. 
Daru::DataFrame.new(
  Routes:   [
        'Repo forks and issue count',
        'Popular repo of SciRuby',
        'Indian election data'
    ],
  Desc:     [
        'Analysis of fork and issue count present in sciruby org',
        'Popular SciRuby repo in the point of view of number of watchers',
        'Plotting a small dataset of obtained election results'
    ],
  Link: [
        "<a href='./sciruby/repos' target='_blank'>sciruby/repos</a>",
        "<a href='./sciruby/watchers' target='_blank'>sciruby/watchers</a>",
        "<a href='./election/data' target='_blank'>election/data</a>"
    ]
)
# => #<Daru::DataFrame(3x3)>
#                  Desc       Link     Routes
#          0 Analysis o <a href='. Repo forks
#          1 Popular Sc <a href='. Popular re
#          2 Plotting a <a href='. Indian ele 

I don't believe it follows POLS.