rdatasets 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4885051665cb07837095ed6c509b1fb6b701fc5646060c4002fd21e21bd82ad5
4
- data.tar.gz: ea511278964d6fe0f460cce77f226d1f6dcab72e8ffde816e4651d3513e66498
3
+ metadata.gz: f389577db8c4aede4d03551b0a6788a0f1970c8b5d79da1f70e77876f9a74d28
4
+ data.tar.gz: b1801bf49f1a39cc3eb8b06e045d7a4a2643fcba624623c8901b18aa1535de40
5
5
  SHA512:
6
- metadata.gz: 0507f82fbf2eb9cd86b59489ddf3ce8bd63163bbcf13b0979c78f8f3c5f3c4776a2c7a2ae52b2d7106aa92f736092a1435db5b28f5d70037e60ebe2652c68509
7
- data.tar.gz: fdea2c475cede1d2718978611cd84b5966659351a806a0d83047c83b6e1b7fe9fbc269b4fe752f5936271d69092a0509e071fb2712befdfc3657f25e4879a422
6
+ metadata.gz: b75eb647f720b21312f4d55d215d988678641d967f64b27362fcb086d1ea59d7780b3a041fc5417c71eb5dce548c2360afa5fd52197a4314a45102dc6f3b860b
7
+ data.tar.gz: aa748bdc70807c89a18b8cc64a9d317225382e9180295689200f564747ce7ef8b04ff7c99fef801813d3d258dad1500ede97d0b1bd804c7fce621366801e3501
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rdatasets (0.4.0)
4
+ rdatasets (0.4.1)
5
5
  daru
6
6
 
7
7
  GEM
data/lib/rdatasets.rb CHANGED
@@ -13,7 +13,11 @@ module RDatasets
13
13
  if dataset_name
14
14
  file_path = filepath(package_name, dataset_name)
15
15
  df = Daru::DataFrame.from_csv(file_path)
16
- df.set_index(df[0].name) if original_index_is_sequential? df
16
+ if original_index_is_sequential? df
17
+ # `df.set_index` is slow
18
+ df.index = df[0]
19
+ df.delete_vector df[0].name
20
+ end
17
21
  df
18
22
  else
19
23
  packages(package_name)
@@ -63,7 +67,7 @@ module RDatasets
63
67
 
64
68
  # Check if the index of original r dataset is sequential.
65
69
  def original_index_is_sequential?(df)
66
- df[0].to_a == [1..df.size]
70
+ df[0].to_a == [*1..df.size]
67
71
  end
68
72
  private_class_method :original_index_is_sequential?
69
73
  end
@@ -1,3 +1,3 @@
1
1
  module RDatasets
2
- VERSION = '0.4.0'.freeze
2
+ VERSION = '0.4.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdatasets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - kojix2