opynsim
Unofficial C++ Documentation
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Friends | List of all members
opyn::Series Class Referencefinal

Represents a single column of a DataFrame. More...

#include <series.h>

Public Types

using value_type = double
 
using size_type = size_t
 
using const_reference = const value_type &
 
using const_iterator = const value_type *
 

Public Member Functions

 Series ()
 Constructs an unnamed empty Series.
 
 Series (std::string name, std::vector< double > values)
 Constructs a Series with name and associated values.
 
osc::CStringView name () const
 Returns the name of this Series.
 
std::tuple< size_t > shape () const
 Returns the shape (rows) of this Series.
 
bool empty () const
 Returns true if this Series contains no rows.
 
size_type size () const
 Returns the number of rows in this Series.
 
const_reference operator[] (size_type pos) const
 Returns a reference to the element at the specified position pos.
 
const_iterator begin () const
 Returns an iterator to the first value in *this.
 
const_iterator end () const
 Returns an iterator past the last value in *this.
 
const double * data () const
 
std::vector< double > to_list () const
 Converts this Series into a std::vector of its values.
 
Series map_elements (const std::function< double(double)> &f) const
 

Friends

bool operator== (const Series &, const Series &)
 
Series operator* (double, const Series &)
 
Series operator* (const Series &, double)
 

Detailed Description

Represents a single column of a DataFrame.

Member Typedef Documentation

◆ const_iterator

◆ const_reference

◆ size_type

using opyn::Series::size_type = size_t

◆ value_type

using opyn::Series::value_type = double

Constructor & Destructor Documentation

◆ Series() [1/2]

opyn::Series::Series ( )

Constructs an unnamed empty Series.

◆ Series() [2/2]

opyn::Series::Series ( std::string  name,
std::vector< double >  values 
)

Constructs a Series with name and associated values.

Member Function Documentation

◆ begin()

const_iterator opyn::Series::begin ( ) const

Returns an iterator to the first value in *this.

◆ data()

const double * opyn::Series::data ( ) const

Returns a pointer to the underlying contiguous array that backs *this (care: this API is unstable and might evolve over time to support chunking, etc.).

◆ empty()

bool opyn::Series::empty ( ) const

Returns true if this Series contains no rows.

◆ end()

const_iterator opyn::Series::end ( ) const

Returns an iterator past the last value in *this.

◆ map_elements()

Series opyn::Series::map_elements ( const std::function< double(double)> &  f) const

Returns a new Series with the same name as *this, but with each data value replaced by f(value).

◆ name()

osc::CStringView opyn::Series::name ( ) const

Returns the name of this Series.

◆ operator[]()

const_reference opyn::Series::operator[] ( size_type  pos) const

Returns a reference to the element at the specified position pos.

◆ shape()

std::tuple< size_t > opyn::Series::shape ( ) const

Returns the shape (rows) of this Series.

◆ size()

size_type opyn::Series::size ( ) const

Returns the number of rows in this Series.

◆ to_list()

std::vector< double > opyn::Series::to_list ( ) const

Converts this Series into a std::vector of its values.

Friends And Related Symbol Documentation

◆ operator* [1/2]

Series operator* ( const Series ,
double   
)
friend

Returns a new Series with the same name as lhs, but with each of its data values multiplied by rhs.

◆ operator* [2/2]

Series operator* ( double  ,
const Series  
)
friend

Returns a new Series with the same name as rhs, but with each of its data values multiplied by lhs.

◆ operator==

bool operator== ( const Series ,
const Series  
)
friend

Returns true all members of lhs compare equivalent to rhs.

Note: This operator confirms to IEEE 754 and C++'s regular type invariants, which means identity checks are non-reflexive for special values. Therefore, if either lhs or rhs contains NaN, this operator will return false.


The documentation for this class was generated from the following file: