What’s new in 0.0.5 (June 4, 2021)

Name change

After bringing in the functionality from py-elevation (see below), a name change was called for.

  • The package name on pip is now pandas-xyz

  • The package name to import is now pandas_xyz

  • The DataFrame accessor is now .xyz

Enhancements

Port py-elevation algorithms

Added elevation-related algorithms to package, along with corresponding DataFrame accessor methods. This functionality was originally found in another one of my projects called py-elevation (now deprecated).

Series methods:

In [1]: df = pd.DataFrame.from_dict({
   ...:   'elevation': [1.0 * i + np.random.normal() for i in range(30)],
   ...:   'distance': [5.0 * i for i in range(30)]
   ...: })
   ...: 

In [2]: df['elev_threshold'] = df.xyz.z_filter_threshold()

In [3]: df['elev_smooth_t'] = df.xyz.z_smooth_time()

In [4]: df['elev_smooth_d'] = df.xyz.z_smooth_distance()

In [5]: df[['elevation', 'elev_threshold', 'elev_smooth_t', 'elev_smooth_d']]
Out[5]: 
    elevation  elev_threshold  elev_smooth_t  elev_smooth_d
0    0.166490        0.166490       0.660774       0.614131
1    2.636797        0.166490       1.548798       1.529276
2    2.069268        0.166490       2.442080       2.454509
3    2.799939        0.166490       3.340618       3.389829
4    4.055761        0.166490       4.244414       4.266722
5    6.308560        6.308560       5.153467       5.179093
6    5.833213        6.308560       6.067777       6.078446
7    5.937002        6.308560       6.987344       6.929670
8    8.402551        6.308560       7.912168       7.953958
9    9.216779        6.308560       8.842250       8.667016
10   9.957512        6.308560       9.777588       9.555322
11   8.731234        6.308560      10.738353      10.497907
12  12.504393       12.504393      11.685176      11.727782
13  13.787863       12.504393      12.389558      12.945825
14  13.821422       12.504393      13.371868      14.554892
15  14.632574       12.504393      14.392230      14.979880
16  16.392001       12.504393      15.491985      15.261867
17  15.423275       12.504393      16.647639      15.737815
18  15.877846       12.504393      17.740192      16.935030
19  18.050991       18.050991      18.890728      17.762497
20  20.747875       18.050991      19.909350      19.023248
21  19.254685       18.050991      20.924652      21.206965
22  22.174346       18.050991      21.936635      22.762832
23  26.445498       26.445498      22.945299      23.904148
24  24.351820       26.445498      23.950644      25.599838
25  25.299577       26.445498      24.952669      26.059513
26  27.227713       26.445498      25.951375      26.013596
27  26.516698       26.445498      26.946761      26.515201
28  26.931180       26.445498      27.938828      27.213904
29  28.082066       26.445498      28.927576      28.109705

Scalar methods:

In [6]: df.xyz.z_gain_naive()
Out[6]: 35.4513378807614

In [7]: df.xyz.z_gain_threshold()
Out[7]: 26.2790079122678

Documentation and README have been updated to explain these new features.