403Webshell
Server IP : 209.209.40.120  /  Your IP : 216.73.217.112
Web Server : Microsoft-IIS/10.0
System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586
User : NEWWWW$ ( 0)
PHP Version : 8.3.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Python312/Lib/site-packages/pandas/tests/tslibs/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python312/Lib/site-packages/pandas/tests/tslibs//test_npy_units.py
import numpy as np

from pandas._libs.tslibs.dtypes import abbrev_to_npy_unit
from pandas._libs.tslibs.vectorized import is_date_array_normalized

# a datetime64 ndarray which *is* normalized
day_arr = np.arange(10, dtype="i8").view("M8[D]")


class TestIsDateArrayNormalized:
    def test_is_date_array_normalized_day(self):
        arr = day_arr
        abbrev = "D"
        unit = abbrev_to_npy_unit(abbrev)
        result = is_date_array_normalized(arr.view("i8"), None, unit)
        assert result is True

    def test_is_date_array_normalized_seconds(self):
        abbrev = "s"
        arr = day_arr.astype(f"M8[{abbrev}]")
        unit = abbrev_to_npy_unit(abbrev)
        result = is_date_array_normalized(arr.view("i8"), None, unit)
        assert result is True

        arr[0] += np.timedelta64(1, abbrev)
        result2 = is_date_array_normalized(arr.view("i8"), None, unit)
        assert result2 is False

Youez - 2016 - github.com/yon3zu
LinuXploit