CellStyle ========= .. cpp:class:: numpy::CellStyle numpy C++ class. Example ------- .. code-block:: cpp #include using namespace numpy; // Use CellStyle CellStyle obj; // ... operations ... Array Creation -------------- .. list-table:: :widths: 40 20 15 25 :header-rows: 1 * - Signature - Return Type - Location - Example * - ``bool empty() const`` - bool - df_styler.h:80 - :ref:`View ` I/O --- .. list-table:: :widths: 40 20 15 25 :header-rows: 1 * - Signature - Return Type - Location - Example * - ``std::string to_css() const`` - std::string - df_styler.h:64 - Other Methods ------------- .. list-table:: :widths: 40 20 15 25 :header-rows: 1 * - Signature - Return Type - Location - Example * - ``void merge(const CellStyle& other)`` - void - df_styler.h:74 - * - ``void set(const std::string& prop, const std::string& value)`` - void - df_styler.h:60 - :ref:`View ` Code Examples ------------- The following examples are extracted from the test suite. .. _example-cellstyle-empty-0: .. dropdown:: empty (np_test_1_all.cpp:6316) :class-title: example-dropdown .. code-block:: cpp :linenos: :lineno-start: 6306 :emphasize-lines: 11 } void test_data_generator_emptyBenchmarkSorting() { std::cout << "========= test_data_generator_empty ======================="; DataGenerator gen(42); // Test empty data generation std::vector data = gen.generate(0, DataPattern::RANDOM); if (!(data.empty())) { std::string description = std::string("test_data_generator_emptyBenchmarkSorting():") + __FILE__ + ":" + std::to_string(__LINE__) + ": !(data.empty())"; std::cout << std::string("[FAIL] ") + description << std::endl; throw std::runtime_error(description); } // std::cout << "Empty data generation test passed" << std::endl; std::cout << " -> tests passed" << std::endl; } .. _example-cellstyle-set-1: .. dropdown:: set (np_test_1_all.cpp:6747) :class-title: example-dropdown .. code-block:: cpp :linenos: :lineno-start: 6737 :emphasize-lines: 11 std::cout << "========= testArrayPrinting ======================="; // Test 1D array printing std::vector words = {"Hello", "World", "Test"}; auto arr_1d = array<16>(words); // std::cout << "1D CharArray:" << std::endl; // arr_1d.print(); // Test 2D array printing chararray16 arr_2d({2, 2}, "test"); arr_2d.set({0, 0}, "A"); arr_2d.set({0, 1}, "B"); arr_2d.set({1, 0}, "C"); arr_2d.set({1, 1}, "D"); // std::cout << "2D CharArray:" << std::endl; // arr_2d.print(); std::cout << " -> tests passed" << std::endl; }