Class: Pandas::Series

Inherits:
Object
  • Object
show all
Defined in:
lib/pandas/series.rb

Instance Method Summary collapse

Instance Method Details

#[](*key) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/pandas/series.rb', line 5

def [](*key)
  if key.length == 1
    case key[0]
    when Array
      key[0] = PyCall::List.new(key[0])
    when Range
      case key[0].begin
      when String
        key[0] = key[0].begin ... key[0].end # force exclude-end
      end
    end
  end
  super
end

#lengthObject



36
37
38
# File 'lib/pandas/series.rb', line 36

def length
  size
end

#monotonic?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/pandas/series.rb', line 20

def monotonic?
  is_monotonic
end

#monotonic_decreasing?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/pandas/series.rb', line 24

def monotonic_decreasing?
  is_monotonic_decreasing
end

#monotonic_increasing?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/pandas/series.rb', line 28

def monotonic_increasing?
  is_monotonic_increasing
end

#to_aObject



40
41
42
# File 'lib/pandas/series.rb', line 40

def to_a
  Array.new(length) {|i| self[i] }
end

#unique?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/pandas/series.rb', line 32

def unique?
  is_unique
end