pandas 0.3.2 → 0.3.3

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: 8543416156440087fbaf48acad949e5a15426d06fa871d4493705dabff8ba722
4
- data.tar.gz: '0304593f38ec6d5e3fd65abe8ded93b4d2d9354571cb4e93650aa292b9390e06'
3
+ metadata.gz: 952bd0798aaf70a04aad070946185ba24462c5ba88d68650d65c096bcb3a8e81
4
+ data.tar.gz: fb70cd2d1f07485ea94fbab52ed054be9d14cbe35948a297d5f011b60f9353cb
5
5
  SHA512:
6
- metadata.gz: 3afba55b10fe1f4e17aa98fd1fa759be3c76673b17abab11ea98f56fb4963434c889f8ee2ee5ec8d986ab975869053da932ea8de870017c3b6e0043f9552c88c
7
- data.tar.gz: a11d1d1ea1f5d5d1d5e5b0fb78dfadc0bede08b335e3e4256a25250668ce8bb2b6c5149a68de5c9e25375401fe9f7aa47226dc6b16c0c9a0bf9e927d6c0eab5b
6
+ metadata.gz: d21e7f9c032f5efae82689ac111167bdc3f9db844748aa2b148261750d39f54a17f3ce5c1578121238ef0dc5af7d04564672a18525f3394157dea4ba0f60b73a
7
+ data.tar.gz: 15bfd63048f2cbbc2f602ad08626a2d2fe838cf026eeaaa583a27223e9255291bea113ae97d23286fbcd89c249b1effb65235b3b18b5620f99446f9eb723e97c
@@ -0,0 +1,69 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ pull_request:
8
+ types:
9
+ - opened
10
+ - synchronize
11
+ - reopened
12
+
13
+ jobs:
14
+ test:
15
+ name: ${{ matrix.os}} ${{ matrix.ruby }} ${{ matrix.python }}-${{ matrix.python_arch }}
16
+ runs-on: ${{ matrix.os }}
17
+
18
+ strategy:
19
+ fail-fast: false
20
+ matrix:
21
+ os:
22
+ - ubuntu-latest
23
+ - macos-latest
24
+ ruby:
25
+ - 3.0
26
+ - 2.7
27
+ - 2.6
28
+ - 2.5
29
+ - 2.4
30
+ - debug
31
+ python:
32
+ - 3.8.x
33
+ - 3.7.x
34
+ - 3.6.x
35
+ - 2.7.x
36
+ python_arch:
37
+ - x64
38
+
39
+ steps:
40
+ - uses: actions/checkout@v2
41
+ with:
42
+ fetch-depth: 1
43
+
44
+ - uses: ruby/setup-ruby@v1
45
+ with:
46
+ ruby-version: ${{ matrix.ruby }}
47
+
48
+ - uses: actions/setup-python@v1
49
+ with:
50
+ python-version: ${{ matrix.python }}
51
+ architecture: ${{ matrix.python_arch }}
52
+
53
+ - run: sudo apt-get install libsqlite3-dev
54
+ if: matrix.os == 'ubuntu-latest'
55
+
56
+ - run: brew install sqlite3
57
+ if: matrix.os == 'macos-latest'
58
+
59
+ - run: pip install -r requirements.txt
60
+
61
+ - run: gem install bundler
62
+ - run: bundle install
63
+
64
+ - run: bundle exec rake
65
+ env:
66
+ PYTHON: python
67
+
68
+ - run: rake build
69
+ - run: gem install pkg/*.gem
data/CHANGES.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # The chenge history of Pandas wrapper for Ruby
2
2
 
3
+ ## 0.3.3
4
+
5
+ * Support array index in `Pandas::Series#[]`
6
+
7
+ * Add predicate methods for `Pandas::Index` and `Pandas::Series`
8
+
9
+ * Support closed-end string ranges in `Pandas::Series#[]`
10
+
11
+ * Support string array index in `Pandas::DataFrame#loc[]`
12
+
13
+ * Support array index in `Pandas::DataFrame#iloc[]`
14
+
3
15
  ## 0.3.2
4
16
 
5
17
  * Fix for pandas 1.0
@@ -1,5 +1,5 @@
1
1
  require "pandas/version"
2
- require "pycall"
2
+ require "numpy"
3
3
 
4
4
  Pandas = PyCall.import_module("pandas")
5
5
  module Pandas
@@ -80,6 +80,9 @@ module Pandas
80
80
  end
81
81
 
82
82
  require 'pandas/data_frame'
83
+ require 'pandas/index'
83
84
  require 'pandas/io'
85
+ require 'pandas/loc_indexer'
84
86
  require 'pandas/options'
87
+ require 'pandas/series'
85
88
  end
@@ -2,10 +2,8 @@ require 'pandas'
2
2
 
3
3
  module Pandas
4
4
  class DataFrame
5
- def [](*key)
6
- if key.length == 1 && key[0].is_a?(Array)
7
- key[0] = PyCall::List.new(key[0])
8
- end
5
+ def [](key)
6
+ key = PyCall::List.new(key) if key.is_a?(Array)
9
7
  super
10
8
  end
11
9
  end
@@ -0,0 +1,21 @@
1
+ require 'pandas'
2
+
3
+ module Pandas
4
+ class Index
5
+ def monotonic?
6
+ is_monotonic
7
+ end
8
+
9
+ def monotonic_decreasing?
10
+ is_monotonic_decreasing
11
+ end
12
+
13
+ def monotonic_increasing?
14
+ is_monotonic_increasing
15
+ end
16
+
17
+ def unique?
18
+ is_unique
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,25 @@
1
+ require 'pandas'
2
+
3
+ module Pandas
4
+ class LocIndexer
5
+ def [](*keys)
6
+ for i in 0...keys.length
7
+ if keys[i].is_a? Array
8
+ keys[i] = PyCall::List.new(keys[i])
9
+ end
10
+ end
11
+ super
12
+ end
13
+ end
14
+
15
+ class IlocIndexer
16
+ def [](*keys)
17
+ for i in 0...keys.length
18
+ if keys[i].is_a? Array
19
+ keys[i] = PyCall::List.new(keys[i])
20
+ end
21
+ end
22
+ super
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,36 @@
1
+ require 'pandas'
2
+
3
+ module Pandas
4
+ class Series
5
+ def [](*key)
6
+ if key.length == 1
7
+ case key[0]
8
+ when Array
9
+ key[0] = PyCall::List.new(key[0])
10
+ when Range
11
+ case key[0].begin
12
+ when String
13
+ key[0] = key[0].begin ... key[0].end # force exclude-end
14
+ end
15
+ end
16
+ end
17
+ super
18
+ end
19
+
20
+ def monotonic?
21
+ is_monotonic
22
+ end
23
+
24
+ def monotonic_decreasing?
25
+ is_monotonic_decreasing
26
+ end
27
+
28
+ def monotonic_increasing?
29
+ is_monotonic_increasing
30
+ end
31
+
32
+ def unique?
33
+ is_unique
34
+ end
35
+ end
36
+ end
@@ -1 +1 @@
1
- PANDAS_VERSION = "0.3.2"
1
+ PANDAS_VERSION = "0.3.3"
@@ -22,6 +22,7 @@ Gem::Specification.new do |spec|
22
22
  spec.require_paths = ["lib"]
23
23
 
24
24
  spec.add_dependency "pycall", ">= 1.0.0"
25
+ spec.add_dependency "numpy"
25
26
 
26
27
  spec.add_development_dependency "bundler", ">= 1.17.2"
27
28
  spec.add_development_dependency "rake"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pandas
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kenta Murata
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-02-04 00:00:00.000000000 Z
11
+ date: 2021-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pycall
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 1.0.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: numpy
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: bundler
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -101,9 +115,9 @@ executables: []
101
115
  extensions: []
102
116
  extra_rdoc_files: []
103
117
  files:
118
+ - ".github/workflows/ci.yml"
104
119
  - ".gitignore"
105
120
  - ".rspec"
106
- - ".travis.yml"
107
121
  - CHANGES.md
108
122
  - Gemfile
109
123
  - LICENSE.txt
@@ -114,9 +128,12 @@ files:
114
128
  - data/titanic.csv
115
129
  - lib/pandas.rb
116
130
  - lib/pandas/data_frame.rb
131
+ - lib/pandas/index.rb
117
132
  - lib/pandas/io.rb
118
133
  - lib/pandas/io/active_record.rb
134
+ - lib/pandas/loc_indexer.rb
119
135
  - lib/pandas/options.rb
136
+ - lib/pandas/series.rb
120
137
  - lib/pandas/version.rb
121
138
  - pandas.gemspec
122
139
  - requirements.txt
@@ -124,7 +141,7 @@ homepage: https://github.com/mrkn/pandas.rb
124
141
  licenses:
125
142
  - MIT
126
143
  metadata: {}
127
- post_install_message:
144
+ post_install_message:
128
145
  rdoc_options: []
129
146
  require_paths:
130
147
  - lib
@@ -139,8 +156,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
156
  - !ruby/object:Gem::Version
140
157
  version: '0'
141
158
  requirements: []
142
- rubygems_version: 3.1.2
143
- signing_key:
159
+ rubygems_version: 3.2.3
160
+ signing_key:
144
161
  specification_version: 4
145
162
  summary: Pandas wrapper for Ruby
146
163
  test_files: []
@@ -1,26 +0,0 @@
1
- sudo: false
2
- language: ruby
3
-
4
- rvm:
5
- - ruby-head
6
- - 2.5.1
7
- - 2.4.4
8
- - 2.3.7
9
- - 2.2.10
10
-
11
- env:
12
- matrix:
13
- - PYTHON=python
14
- - PYENV_VERSION=3.6 PYTHON=python
15
-
16
- before_install:
17
- - gem update --system
18
- - gem update bundler
19
-
20
- before_script:
21
- - pip install --user -r requirements.txt
22
- - PYENV_VERSION=3.6 pip3 install --user -r requirements.txt
23
-
24
- matrix:
25
- allow_failures:
26
- - env: PYTHON=python # Ignore failed on python 2.7