traja-team / traja

Python tools for spatial trajectory and time-series data analysis
https://traja.readthedocs.io
MIT License
98 stars 25 forks source link

Fix SettingWithCopyWarning caused in plotting.py #9

Open JustinShenk opened 5 years ago

JustinShenk commented 5 years ago

Happens with:

import traja; df = traja.generate()
traja.plotting.polar_bar(df)

Output:

See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy
  trj['turn_angle'] = feature_series
/home/justin/anaconda3/envs/traja-gui/lib/python3.6/site-packages/pandas/core/generic.py:5096: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead