FBBuilder#

class pandas::FBBuilder#

Utility class for pandas operations.

Example#

#include <pandas/pandas.h>
using namespace pandas;

// Use FBBuilder
FBBuilder obj;
// ... operations ...

Missing Data#

Signature

Return Type

Location

Example

void pad(size_t alignment)

void

pd_dataframe.h:39937

View

pad(4)

pd_dataframe.h:39942

View

pad(4)

pd_dataframe.h:39951

View

Other Methods#

Signature

Return Type

Location

Example

int32_t current_offset() const

int32_t

pd_dataframe.h:39973

void write_i16(int16_t val)

void

pd_dataframe.h:39955

void write_i32(int32_t val)

void

pd_dataframe.h:39960

void write_i64(int64_t val)

void

pd_dataframe.h:39967

int32_t write_string(const std::string& s)

int32_t

pd_dataframe.h:39941

Code Examples#

The following examples are extracted from the test suite.

pad (pd_test_3_all.cpp:1771)
1761    if (result_single.nrows() != 3 || result_single.ncols() != 1) {
1762        std::cout << "  [FAIL] : in pd_test_3_all_dataframe_unstack() : single col shape mismatch" << std::endl;
1763        throw std::runtime_error("pd_test_3_all_dataframe_unstack failed: single col shape");
1764    }
1765
1766    std::cout << " -> tests passed" << std::endl;
1767}
1768
1769void pd_test_3_all_fbbuilder_pad() {
1770    std::cout << "========= FBBuilder.pad() (internal) =================";
1771
1772    // Note: FBBuilder.pad() is an internal method for FlatBuffer serialization
1773    // It's not the pandas DataFrame.pad() method (which is ffill alias)
1774    // This test verifies the to_feather() serialization works, which uses FBBuilder.pad()
1775
1776    std::map<std::string, std::vector<double>> data = {
1777        {"A", {1.0, 2.0, 3.0}},
1778        {"B", {4.0, 5.0, 6.0}}
1779    };
1780    pandas::DataFrame df(data);
pad (pd_test_3_all.cpp:1771)
1761    if (result_single.nrows() != 3 || result_single.ncols() != 1) {
1762        std::cout << "  [FAIL] : in pd_test_3_all_dataframe_unstack() : single col shape mismatch" << std::endl;
1763        throw std::runtime_error("pd_test_3_all_dataframe_unstack failed: single col shape");
1764    }
1765
1766    std::cout << " -> tests passed" << std::endl;
1767}
1768
1769void pd_test_3_all_fbbuilder_pad() {
1770    std::cout << "========= FBBuilder.pad() (internal) =================";
1771
1772    // Note: FBBuilder.pad() is an internal method for FlatBuffer serialization
1773    // It's not the pandas DataFrame.pad() method (which is ffill alias)
1774    // This test verifies the to_feather() serialization works, which uses FBBuilder.pad()
1775
1776    std::map<std::string, std::vector<double>> data = {
1777        {"A", {1.0, 2.0, 3.0}},
1778        {"B", {4.0, 5.0, 6.0}}
1779    };
1780    pandas::DataFrame df(data);
pad (pd_test_3_all.cpp:1771)
1761    if (result_single.nrows() != 3 || result_single.ncols() != 1) {
1762        std::cout << "  [FAIL] : in pd_test_3_all_dataframe_unstack() : single col shape mismatch" << std::endl;
1763        throw std::runtime_error("pd_test_3_all_dataframe_unstack failed: single col shape");
1764    }
1765
1766    std::cout << " -> tests passed" << std::endl;
1767}
1768
1769void pd_test_3_all_fbbuilder_pad() {
1770    std::cout << "========= FBBuilder.pad() (internal) =================";
1771
1772    // Note: FBBuilder.pad() is an internal method for FlatBuffer serialization
1773    // It's not the pandas DataFrame.pad() method (which is ffill alias)
1774    // This test verifies the to_feather() serialization works, which uses FBBuilder.pad()
1775
1776    std::map<std::string, std::vector<double>> data = {
1777        {"A", {1.0, 2.0, 3.0}},
1778        {"B", {4.0, 5.0, 6.0}}
1779    };
1780    pandas::DataFrame df(data);