>>> import pandas as pd
>>> df = pd.DataFrame({"loc": list("aaabbbcdd"), "dist": [ 1,1,2,1,2,2,4,1,1 ]})
>>> df
loc dist
0 a 1
1 a 1
2 a 2
3 b 1
4 b 2
5 b 2
6 c 4
7 d 1
8 d 1
>>> df[df["dist"]>=2]
loc dist
2 a 2
4 b 2
5 b 2
6 c 4
>>> df[df["dist"]>=2].groupby("loc").count()
dist
loc
a 1
b 2
c 1
606 Uncaught (inpromise) Error on Electron: An object could not be cloned
885 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
572 Understanding How to Configure Google API Key
597 GDB gets version error when attempting to debug with the Presense SDK (IDE)
© 2024 OneMinuteCode. All rights reserved.