Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

number of unique pairs in columns pandas

#df named df1 columns A and B
df1.groupby(['A','B']).size().reset_index().rename(columns={0:'count'})
Comment

PREVIOUS NEXT
Code Example
Python :: mongo db python 
Python :: pyauto gui save screenshot 
Python :: how to create a matrix using python 
Python :: python find the average of a list 
Python :: python cross validation 
Python :: drop duplicate index pandas 
Python :: openpyxl load file 
Python :: secondary y axis matplotlib 
Python :: how to put in code to download discord py 
Python :: pandas sep 
Python :: python tkinter colored line 
Python :: user input python 
Python :: dataframe to text file 
Python :: logging - multiple log file 
Python :: networkx max degree node 
Python :: Python program to draw star 
Python :: discord py edit message 
Python :: python soap 
Python :: create a blank image opencv 
Python :: how to play mp3 files using vlc python library 
Python :: ms access python dataframe 
Python :: find different between list 
Python :: pip in vscode linux 
Python :: python isnan 
Python :: use loc for change values pandas 
Python :: print column in pandas 
Python :: python gui drag and drop 
Python :: python rdp server 
Python :: python pygame how to start a game 
Python :: how to get scrapy output file in csv 
ADD CONTENT
Topic
Content
Source link
Name
5+9 =