I was wondering what version of pandas is compatible with the latest trackpy version? I currently have installed Trackpy version: 0.6.1 with Pandas version: 2.0.3. Currently I am trying to run the following line of code.
em = tp.emsd(tm, 100/285., 24)
However I am receiving the following error traceback
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[31], line 2
1 #em = tp.emsd(tm, 100/285., 24) # microns per pixel = 100/285., frames per second = 24
----> 2 em = tp.emsd(tm, 100/285., 24)
File ~/opt/anaconda3/lib/python3.8/site-packages/trackpy/motion.py:235, in emsd(traj, mpp, fps, max_lagtime, detail, pos_columns)
233 ids.append(pid)
234 msds = pandas_concat(msds, keys=ids, names=['particle', 'frame'])
--> 235 results = msds.mul(msds['N'], axis=0).mean(level=1) # weighted average
236 results = results.div(msds['N'].mean(level=1), axis=0) # weights normalized
237 # Above, lagt is lumped in with the rest for simplicity and speed.
238 # Here, rebuild it from the frame index.
File ~/opt/anaconda3/lib/python3.8/site-packages/pandas/core/generic.py:11556, in NDFrame._add_numeric_operations.<locals>.mean(self, axis, skipna, numeric_only, **kwargs)
11539 @doc(
11540 _num_doc,
11541 desc="Return the mean of the values over the requested axis.",
(...)
11554 **kwargs,
11555 ):
> 11556 return NDFrame.mean(self, axis, skipna, numeric_only, **kwargs)
File ~/opt/anaconda3/lib/python3.8/site-packages/pandas/core/generic.py:11201, in NDFrame.mean(self, axis, skipna, numeric_only, **kwargs)
11194 def mean(
11195 self,
11196 axis: Axis | None = 0,
(...)
11199 **kwargs,
11200 ) -> Series | float:
> 11201 return self._stat_function(
11202 "mean", nanops.nanmean, axis, skipna, numeric_only, **kwargs
11203 )
File ~/opt/anaconda3/lib/python3.8/site-packages/pandas/core/generic.py:11154, in NDFrame._stat_function(self, name, func, axis, skipna, numeric_only, **kwargs)
11152 nv.validate_median((), kwargs)
11153 else:
> 11154 nv.validate_stat_func((), kwargs, fname=name)
11156 validate_bool_kwarg(skipna, "skipna", none_allowed=False)
11158 return self._reduce(
11159 func, name=name, axis=axis, skipna=skipna, numeric_only=numeric_only
11160 )
File ~/opt/anaconda3/lib/python3.8/site-packages/pandas/compat/numpy/function.py:80, in CompatValidator.__call__(self, args, kwargs, fname, max_fname_arg_count, method)
78 validate_args(fname, args, max_fname_arg_count, self.defaults)
79 elif method == "kwargs":
---> 80 validate_kwargs(fname, kwargs, self.defaults)
81 elif method == "both":
82 validate_args_and_kwargs(
83 fname, args, kwargs, max_fname_arg_count, self.defaults
84 )
File ~/opt/anaconda3/lib/python3.8/site-packages/pandas/util/_validators.py:162, in validate_kwargs(fname, kwargs, compat_args)
140 """
141 Checks whether parameters passed to the **kwargs argument in a
142 function `fname` are valid parameters as specified in `*compat_args`
(...)
159 map to the default values specified in `compat_args`
160 """
161 kwds = kwargs.copy()
--> 162 _check_for_invalid_keys(fname, kwargs, compat_args)
163 _check_for_default_values(fname, kwds, compat_args)
File ~/opt/anaconda3/lib/python3.8/site-packages/pandas/util/_validators.py:136, in _check_for_invalid_keys(fname, kwargs, compat_args)
134 if diff:
135 bad_arg = list(diff)[0]
--> 136 raise TypeError(f"{fname}() got an unexpected keyword argument '{bad_arg}'")
TypeError: mean() got an unexpected keyword argument 'level'
I tried updating pandas however the issue is still happening. I was not too sure if there was any tips that someone had.