Posts by Daniel Miloca - Brazil • 14 points
2 posts
-
0
votes2
answers870
viewsA: Adding total sum grouped to a new column Dataframe pyspark
I know the post is old, but it’s for future research. Would that be? import pandas as pd df = pd.DataFrame(data={'COL1':['A','B','A','B','C','D'], 'COL2':['asd','adf','adg','adh','adj','adk',],…
-
-2
votes2
answers4270
viewsA: Filter lines in pandas by a list
Taking the example provided by Clayton, it can be done directly, without using function: x = dfteste.loc[dfteste['nome'].isin(['fiz','zoo','far'])] print(x)