Skip to content

Pandas TypeErrors in hourly_timeseries #117

@mhidas

Description

@mhidas

A couple of similar errors while trying to create the hourly products in the pipeline for some sites.

  • TypeError: Operation sub between float64 and Timedelta is invalid
TypeError: Operation sub between float64 and Timedelta is invalid
  ...
  File "/mnt/ebs/pipeline/lib/python3.5/site-packages/aodntools/timeseries_products/hourly_timeseries.py", line 399, in PDresample_by_hour
    df.index = df.index - pd.Timedelta(30, units='m')

occurs for

  • ITFTIS (306 input files, task id e103219b-f5b1-4f4a-a7eb-0e4c4217a491)
  • PH100
  • SAM7DS
  • TypeError: Only valid with DatetimeIndex, TimedeltaIndex or PeriodIndex, but got an instance of 'Index'
TypeError: Only valid with DatetimeIndex, TimedeltaIndex or PeriodIndex, but got an instance of 'Index'
  ...
  File "/mnt/ebs/pipeline/lib/python3.5/site-packages/aodntools/timeseries_products/hourly_timeseries.py", line 405, in PDresample_by_hour
    ds_var_mean = ds_var.resample('1H').apply(function_dict[variable]).astype(np.float32)

for

  • SYD100
  • SYD140
  • While fixing this, should also apply the work-around for the pandas.Timedelta units issue, as done in the velocity hourly code (Velocity HOURLY #99 (comment))

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinghourly_timeseriesIssues relating to the hourly time series product

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions