-
Notifications
You must be signed in to change notification settings - Fork 13
Description
Hello,
When running the Plotly webinar notebook from github, at the following command:
df_pvss = endaq.calc.shock.pseudo_velocity(df, get_log_freqs(df,init_freq=1,bins_per_octave=12), damp=0.05, two_sided=False)-'
I get the following error message:
`---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
in
----> 1 df_pvss = endaq.calc.shock.pseudo_velocity(df,
2 get_log_freqs(df,init_freq=1,bins_per_octave=12),
3 damp=0.05, two_sided=False)
4 df_pvss = df_pvss9.8139.37 #convert to in/s
TypeError: pseudo_velocity() got an unexpected keyword argument 'two_sided'`
When removing this argument from the list I get new error messages running either Python 3.8, 3.9 or 3.10:
`/usr/local/lib/python3.8/dist-packages/numpy/core/shape_base.py:65: VisibleDeprecationWarning:
Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
ValueError Traceback (most recent call last)
in
----> 1 df_pvss = endaq.calc.shock.pseudo_velocity(df,
2 get_log_freqs(df,init_freq=1,bins_per_octave=12),
3 damp=0.05)
4 df_pvss = df_pvss9.8139.37 #convert to in/s
/usr/local/lib/python3.8/dist-packages/endaq/calc/shock.py in pseudo_velocity(accel, omega, damp)
313 Q = 1./(2.*damp)
314
--> 315 return accel.apply(
316 functools.partial(
317 scipy.signal.lfilter,
/usr/local/lib/python3.8/dist-packages/pandas/core/frame.py in apply(self, func, axis, raw, result_type, args, **kwargs)
8738 kwargs=kwargs,
8739 )
-> 8740 return op.apply()
8741
8742 def applymap(
/usr/local/lib/python3.8/dist-packages/pandas/core/apply.py in apply(self)
684 # raw
685 elif self.raw:
--> 686 return self.apply_raw()
687
688 return self.apply_standard()
/usr/local/lib/python3.8/dist-packages/pandas/core/apply.py in apply_raw(self)
772 return wrapper
773
--> 774 result = np.apply_along_axis(wrap_function(self.f), self.axis, self.values)
775
776 # TODO: mixed type case
<array_function internals> in apply_along_axis(*args, **kwargs)
/usr/local/lib/python3.8/dist-packages/numpy/lib/shape_base.py in apply_along_axis(func1d, axis, arr, *args, **kwargs)
377 'Cannot apply_along_axis when any iteration dimensions are 0'
378 ) from None
--> 379 res = asanyarray(func1d(inarr_view[ind0], *args, **kwargs))
380
381 # build a buffer for storing evaluations of func1d.
/usr/local/lib/python3.8/dist-packages/pandas/core/apply.py in wrapper(*args, **kwargs)
765
766 def wrapper(*args, **kwargs):
--> 767 result = func(*args, **kwargs)
768 if isinstance(result, str):
769 result = np.array(result, dtype=object)
/usr/local/lib/python3.8/dist-packages/scipy/signal/signaltools.py in lfilter(b, a, x, axis, zi)
2053 else:
2054 if zi is None:
-> 2055 return sigtools._linear_filter(b, a, x, axis)
2056 else:
2057 return sigtools._linear_filter(b, a, x, axis, zi)
ValueError: could not convert b, a, and x to a common type`
Is there a way to fix this ?
Thanks a lot for your help and for providing this software as an open version !
Gilles