FBBuilder ========= .. cpp:class:: pandas::FBBuilder Utility class for pandas operations. Example ------- .. code-block:: cpp #include using namespace pandas; // Use FBBuilder FBBuilder obj; // ... operations ... Missing Data ------------ .. list-table:: :widths: 40 20 15 25 :header-rows: 1 * - Signature - Return Type - Location - Example * - ``void pad(size_t alignment)`` - void - pd_dataframe.h:39937 - :ref:`View ` * - ``pad(4)`` - - pd_dataframe.h:39942 - :ref:`View ` * - ``pad(4)`` - - pd_dataframe.h:39951 - :ref:`View ` Other Methods ------------- .. list-table:: :widths: 40 20 15 25 :header-rows: 1 * - 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. .. _example-fbbuilder-pad-0: .. dropdown:: pad (pd_test_3_all.cpp:1771) :class-title: example-dropdown .. code-block:: cpp :linenos: :lineno-start: 1761 :emphasize-lines: 11 if (result_single.nrows() != 3 || result_single.ncols() != 1) { std::cout << " [FAIL] : in pd_test_3_all_dataframe_unstack() : single col shape mismatch" << std::endl; throw std::runtime_error("pd_test_3_all_dataframe_unstack failed: single col shape"); } std::cout << " -> tests passed" << std::endl; } void pd_test_3_all_fbbuilder_pad() { std::cout << "========= FBBuilder.pad() (internal) ================="; // Note: FBBuilder.pad() is an internal method for FlatBuffer serialization // It's not the pandas DataFrame.pad() method (which is ffill alias) // This test verifies the to_feather() serialization works, which uses FBBuilder.pad() std::map> data = { {"A", {1.0, 2.0, 3.0}}, {"B", {4.0, 5.0, 6.0}} }; pandas::DataFrame df(data); .. _example-fbbuilder-pad-1: .. dropdown:: pad (pd_test_3_all.cpp:1771) :class-title: example-dropdown .. code-block:: cpp :linenos: :lineno-start: 1761 :emphasize-lines: 11 if (result_single.nrows() != 3 || result_single.ncols() != 1) { std::cout << " [FAIL] : in pd_test_3_all_dataframe_unstack() : single col shape mismatch" << std::endl; throw std::runtime_error("pd_test_3_all_dataframe_unstack failed: single col shape"); } std::cout << " -> tests passed" << std::endl; } void pd_test_3_all_fbbuilder_pad() { std::cout << "========= FBBuilder.pad() (internal) ================="; // Note: FBBuilder.pad() is an internal method for FlatBuffer serialization // It's not the pandas DataFrame.pad() method (which is ffill alias) // This test verifies the to_feather() serialization works, which uses FBBuilder.pad() std::map> data = { {"A", {1.0, 2.0, 3.0}}, {"B", {4.0, 5.0, 6.0}} }; pandas::DataFrame df(data); .. _example-fbbuilder-pad-2: .. dropdown:: pad (pd_test_3_all.cpp:1771) :class-title: example-dropdown .. code-block:: cpp :linenos: :lineno-start: 1761 :emphasize-lines: 11 if (result_single.nrows() != 3 || result_single.ncols() != 1) { std::cout << " [FAIL] : in pd_test_3_all_dataframe_unstack() : single col shape mismatch" << std::endl; throw std::runtime_error("pd_test_3_all_dataframe_unstack failed: single col shape"); } std::cout << " -> tests passed" << std::endl; } void pd_test_3_all_fbbuilder_pad() { std::cout << "========= FBBuilder.pad() (internal) ================="; // Note: FBBuilder.pad() is an internal method for FlatBuffer serialization // It's not the pandas DataFrame.pad() method (which is ffill alias) // This test verifies the to_feather() serialization works, which uses FBBuilder.pad() std::map> data = { {"A", {1.0, 2.0, 3.0}}, {"B", {4.0, 5.0, 6.0}} }; pandas::DataFrame df(data);