Dataframe – difference of rows by some style
Advertisements I want the difference of column ‘position’ by the column ‘Seg’ with ‘x’ adjacent. import numpy as np import pandas as pd mydict = {‘position’:[‘0.0’, ‘0.433’, ‘2.013’, ‘3.593’, ‘5.173’, ‘6.753’, ‘6.9’],’Seg’:[‘x’, ‘x’, np.nan, np.nan, np.nan, np.nan, ‘x’]} df = pd.DataFrame.from_dict(mydict) df position Seg 0 0.0 x 1 0.433 x 2 2.013 NaN 3 3.593… Read More Dataframe – difference of rows by some style