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
and I try to take a subset of column, it is only allowed when I only pick the origin OR the destination
Like
fdf[["origin", "flow"]] or fdf[["destination", "flow"]]
But if I do something like fdf["origin", "destination", "flow", "attr_1"] it fails with the error
File [/opt/anaconda3/envs/GSA/lib/python3.9/site-packages/skmob/core/flowdataframe.py:319](https://file+.vscode-resource.vscode-cdn.net/opt/anaconda3/envs/GSA/lib/python3.9/site-packages/skmob/core/flowdataframe.py:319), in FlowDataFrame.__getitem__(self, key)
314 """
315 It the result contains lat, lng and datetime, return a TrajDataFrame, else a pandas DataFrame.
316 """
317 result = super(FlowDataFrame, self).__getitem__(key)
--> 319 if (isinstance(result, FlowDataFrame)) and result._is_flowdataframe():
320 result.__class__ = FlowDataFrame
321 result.tessellation = self._tessellation
File [/opt/anaconda3/envs/GSA/lib/python3.9/site-packages/skmob/core/flowdataframe.py:277](https://file+.vscode-resource.vscode-cdn.net/opt/anaconda3/envs/GSA/lib/python3.9/site-packages/skmob/core/flowdataframe.py:277), in FlowDataFrame._is_flowdataframe(self)
271 def _is_flowdataframe(self):
273 if ((constants.ORIGIN in self) and
274 pd.core.dtypes.common.is_string_dtype(self[constants.ORIGIN])) \
275 and ((constants.DESTINATION in self) and
276 pd.core.dtypes.common.is_string_dtype(self[constants.DESTINATION])) \
--> 277 and ((constants.TILE_ID in self._tessellation) and
278 pd.core.dtypes.common.is_string_dtype(self._tessellation[constants.TILE_ID])) \
279 and ((constants.FLOW in self) and
280 (pd.core.dtypes.common.is_float_dtype(self[constants.FLOW]) or
281 pd.core.dtypes.common.is_integer_dtype(self[constants.FLOW]))):
282 return True
284 return False
TypeError: argument of type 'NoneType' is not iterable
The text was updated successfully, but these errors were encountered:
If I have a FlowDataFrame whose columns are
origin | destination | flow | attr_1 | attr_2
and I try to take a subset of column, it is only allowed when I only pick the origin OR the destination
Like
fdf[["origin", "flow"]]
orfdf[["destination", "flow"]]
But if I do something like
fdf["origin", "destination", "flow", "attr_1"]
it fails with the errorThe text was updated successfully, but these errors were encountered: