You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since pandas is widely used for data science, including working with time series, a canonic representation of the frequency, as defined by SI standards, physics etc. would be a nice improvement.
To summarize differences between the general definition of frequency and the pandas definition of frequency:
General definition: Frequency is in the unit of 1/time_period, for SI unis more specifically 1/second=1Hz.
pandas definition: Frequency is the time period, so it is exactly the opposite of the physical/general definition.
Since many calculations require the actual frequency, for example summing up velocities to get the length, this would facilitate many calculations.
Proposed solution:
Additionally pd.DatetimeIndex etc. should get a new attribute, f.i. named freq_canonic, that represents the actual frequency of the index in Hertz.
To avoid breaking the API, I'd implement the frequency as a data attribute, which can be accessed by the user, but has no effect on time series calculations.
I could try making a pull request for this feature, if you are interested.
The text was updated successfully, but these errors were encountered:
Good question... :)
I guess if the Hertz dtype was added automatically during DatetimeIndex creation, it would be a really nice solution. But would it be possible to directly make some calculations with the Hertz dtype without the need for any conversions? Like f.i. velocity/Hertz_dtype?
If not, imho an attribute is quite important. F.i. a period/freq of '20s' would yield DatetimeIndex.freq_canonic as a float, in this case 0.05 (unit Hz: 1/s).
Since pandas is widely used for data science, including working with time series, a canonic representation of the frequency, as defined by SI standards, physics etc. would be a nice improvement.
To summarize differences between the general definition of frequency and the pandas definition of frequency:
1/time_period
, for SI unis more specifically1/second=1Hz
.Since many calculations require the actual frequency, for example summing up velocities to get the length, this would facilitate many calculations.
Proposed solution:
Additionally
pd.DatetimeIndex
etc. should get a new attribute, f.i. namedfreq_canonic
, that represents the actual frequency of the index in Hertz.To avoid breaking the API, I'd implement the frequency as a data attribute, which can be accessed by the user, but has no effect on time series calculations.
I could try making a pull request for this feature, if you are interested.
The text was updated successfully, but these errors were encountered: