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    1.640474        1.640474      -0.237602       1.088482
1   -0.018118        1.640474       0.833636       1.090520
2    1.563977        1.640474       1.895083       1.395762
3    2.446339        1.640474       2.946741       2.004210
4    3.386685        1.640474       3.988608       3.202577
5    3.421065        1.640474       5.020686       4.103694
6    5.833915        1.640474       6.042973       5.348200
7    6.943504        6.943504       7.055471       7.462821
8    9.067528        6.943504       8.058178       9.116781
9   11.591286        6.943504       9.051096      10.352987
10   9.778818        6.943504      10.034223      10.659766
11  11.612551        6.943504      11.260904      11.318173
12  10.402340        6.943504      12.100836      11.433507
13  14.171126       14.171126      13.067168      12.361990
14  11.922680       14.171126      13.936738      13.256878
15  14.668363       14.171126      14.708947      14.876302
16  16.415659       14.171126      15.450879      15.942411
17  17.665079       14.171126      16.423550      17.077576
18  17.505088       14.171126      17.314607      17.757973
19  17.030339       14.171126      18.312950      17.869006
20  19.900846       19.900846      19.323848      18.763887
21  18.701744       19.900846      20.367759      19.922231
22  22.333999       19.900846      21.444684      21.164408
23  21.921946       19.900846      22.554623      22.484613
24  23.900554       19.900846      23.697575      24.599716
25  26.485544       26.485544      24.873541      25.483903
26  27.222116       26.485544      26.082520      26.697654
27  26.209823       26.485544      27.324512      27.698821
28  28.350092       26.485544      28.599519      28.464179
29  29.492167       26.485544      29.907538      28.993727

Scalar methods:

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

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

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