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 +4 -4
- data/.github/workflows/ci.yml +69 -0
- data/CHANGES.md +12 -0
- data/lib/pandas.rb +4 -1
- data/lib/pandas/data_frame.rb +2 -4
- data/lib/pandas/index.rb +21 -0
- data/lib/pandas/loc_indexer.rb +25 -0
- data/lib/pandas/series.rb +36 -0
- data/lib/pandas/version.rb +1 -1
- data/pandas.gemspec +1 -0
- metadata +24 -7
- data/.travis.yml +0 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 952bd0798aaf70a04aad070946185ba24462c5ba88d68650d65c096bcb3a8e81
|
4
|
+
data.tar.gz: fb70cd2d1f07485ea94fbab52ed054be9d14cbe35948a297d5f011b60f9353cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/pandas.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
require "pandas/version"
|
2
|
-
require "
|
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
|
data/lib/pandas/data_frame.rb
CHANGED
data/lib/pandas/index.rb
ADDED
@@ -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
|
data/lib/pandas/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
PANDAS_VERSION = "0.3.
|
1
|
+
PANDAS_VERSION = "0.3.3"
|
data/pandas.gemspec
CHANGED
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.
|
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:
|
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.
|
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: []
|
data/.travis.yml
DELETED
@@ -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
|