예제 #1
0
파일: index.py 프로젝트: edmoody/pandas
def _to_m8(key):
    """
    Timestamp-like => dt64
    """
    if not isinstance(key, datetime):
        # this also converts strings
        key = Timestamp(key)

    if np.__version__[:3] == "1.6":
        return np.datetime64(lib.pydt_to_i8(key))
    else:
        return np.datetime64(lib.pydt_to_i8(key), "us")
예제 #2
0
파일: index.py 프로젝트: andreas-h/pandas
def _to_m8(key):
    """
    Timestamp-like => dt64
    """
    if not isinstance(key, datetime):
        # this also converts strings
        key = Timestamp(key)

    return np.int64(lib.pydt_to_i8(key)).view("M8[ns]")
예제 #3
0
파일: index.py 프로젝트: candre717/pandas
def _to_m8(key):
    '''
    Timestamp-like => dt64
    '''
    if not isinstance(key, datetime):
        # this also converts strings
        key = Timestamp(key)

    return np.datetime64(lib.pydt_to_i8(key))