python - Thresholding a pandas dataframe by column -


i have data collected sensor 6 degrees-of-freedom , trying perform plotting , eventual signal processing tasks on it.

i made pandas dataframe , trying threshold or clip data set based on column "stamp" timestamp value in seconds. far have created dataframe:

headers = ["stamp", "liny1", "linz1", "angy1", "angz1", "linx2", "liny2"] df = pd.read_csv("test2.csv", header=0, names = headers, delimiter = ';') df 

which gave me:

head of dataframe

i wish threshold data until 18 second mark since after noise. tried using threshold function in pandas i'm not sure if did right. can point out mistake is?

df_thresh = df.clip(lower=none, upper=18) 

it sounds want use loc filter data under 19 seconds.

df.loc[df['stamp'] < 19]  # not sure units 'stamp' in. seconds? 

for reference, doing if clip data, not believe want:

>>> pd.series(range(16,21)).clip_upper(18) 0    16 1    17 2    18 3    18 4    18 dtype: int64 

Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -