Skip to content

Error in using - rdtools.degradation_year_on_year - function #374

@AlbertoFollo

Description

@AlbertoFollo

I'm trying to calculate the performance loss rate of a vertically installed PV module using the function rdtools.degradation_year_on_year.
However, the following error displays every time I run the function.

ValueError: Cannot convert from timedelta64[ns] to timedelta64[h]. Supported resolutions are 's', 'ms', 'us', 'ns'.

Here is what I'm doing:

daily['Timestamp'] = daily.index
daily['Timestamp'] = daily['Timestamp'].dt.to_timestamp() # From period(D) to DateTime

daily = daily.set_index(daily['Timestamp'])
daily = daily.rename(columns = {'PR [%]': 'PR'})

MPR = daily.PR
MPR.index = daily.index

yoy_rd, yoy_ci, yoy_info = rdtools.degradation_year_on_year(MPR, confidence_level=95)

Where, daily.info()

DatetimeIndex: 1147 entries, 2020-02-27 to 2023-04-18
Data columns (total 6 columns):
Column Non-Null Count Dtype


0 H [Wh/m2] 954 non-null float64
1 Em [Wh] 954 non-null float64
2 Em_Tcorr [Wh] 954 non-null float64
3 PR 954 non-null float64
4 PR_Tcorr [%] 954 non-null float64
5 Timestamp 1147 non-null datetime64[ns]
dtypes: datetime64ns, float64(5)
memory usage: 62.7 KB

I tried to convert datetime64[ns] to datetime64[h] before running the function, but there seems to be no way to do this in python.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions