BusdayCalendar#
-
class numpy::BusdayCalendar#
numpy C++ class.
Example#
#include <numpy/np_ndarray.h>
using namespace numpy;
// Use BusdayCalendar
BusdayCalendar obj;
// ... operations ...
Constructors#
Signature |
Location |
Example |
|---|---|---|
|
NP_DATETIME_UTILS.H:114 |
|
|
NP_DATETIME_UTILS.H:118 |
Indexing / Selection#
Signature |
Return Type |
Location |
Example |
|---|---|---|---|
|
const std::set<datetime64>& |
NP_DATETIME_UTILS.H:123 |
|
|
const Weekmask & |
NP_DATETIME_UTILS.H:122 |
Other Methods#
Signature |
Return Type |
Location |
Example |
|---|---|---|---|
|
bool |
NP_DATETIME_UTILS.H:125 |
Code Examples#
The following examples are extracted from the test suite.
isBusinessDay (np_test_1_all.cpp:6952)
6942 std::cout << " -> tests passed" << std::endl;
6943}
6944
6945void testDatetimeUtilsDateTime() {
6946 std::cout << "========= testDatetimeUtilsDateTime =======================";
6947
6948 datetime64 test_date("2024-03-15"); // Friday
6949
6950 // std::cout << "Test date: " << test_date.toString() << std::endl;
6951 // std::cout << "Is weekend: " << datetime_utils::isWeekend(test_date) << std::endl;
6952 // std::cout << "Is business day: " << datetime_utils::isBusinessDay(test_date) << std::endl;
6953 // std::cout << "Weekday: " << datetime_utils::getWeekday(test_date) << std::endl;
6954 // std::cout << "Day of year: " << datetime_utils::getDayOfYear(test_date) << std::endl;
6955
6956 // Test start/end of periods
6957 // std::cout << "Start of week: " << datetime_utils::startOfWeek(test_date).toString() << std::endl;
6958 // std::cout << "End of week: " << datetime_utils::endOfWeek(test_date).toString() << std::endl;
6959 // std::cout << "Start of month: " << datetime_utils::startOfMonth(test_date).toString() << std::endl;
6960 // std::cout << "End of month: " << datetime_utils::endOfMonth(test_date).toString() << std::endl;
6961
6962 // Test business day calculations