Skip to content

請問該庫怎麼用numpy向量化呢? #34

@OwenChen0911

Description

@OwenChen0911

我有大量的日期要轉換天干地支

lunar = sxtwl.Lunar()
vfunc = np.vectorize(lunar.getDayBySolar)
day = vfunc(date_df.year, date_df.month, date_df.day)

試著想將其向量化,但不知正確用法

會出現這樣錯誤

TypeError: in method 'Lunar_getDayBySolar', argument 2 of type 'int'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions