Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ranks = pd.read_csv("/tmp_file.csv")
- print(ranks)
- mask=(ranks["Date/Time"] > pd.Timestamp(start_time)) & (ranks["Date/Time"] < pd.Timestamp(end_time)) & (ranks["Op/sc"]>100)
- df = ranks.loc[mask]
- print(df)
- df.replace(regex=r'2019.*$', value='2018', inplace=True)
- print(df)
- Date/Time Rank Op/sc
- 0 2019-03-18 03:07:57 0 6
- 1 2019-03-18 03:08:12 0 5
- 2 2019-03-18 03:08:27 0 4
- 3 2019-03-18 03:08:42 0 4
- 4 2019-03-18 03:08:57 0 7
- Date/Time Rank Op/sc
- 25 2019-03-18 03:14:12 0 160
- 26 2019-03-18 03:14:27 0 103
- 27 2019-03-18 03:14:42 0 129
- 32 2019-03-18 03:15:57 0 119
- Date/Time Rank Op/sc
- 25 2019-03-18 03:14:12 0 160
- 26 2019-03-18 03:14:27 0 103
- 27 2019-03-18 03:14:42 0 129
- 32 2019-03-18 03:15:57 0 119
- ranks = pd.read_csv("/tmp_file.csv", parse_dates=['Date/Time'])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement