Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

equivalent count distinct pandas

df.groupby('column1').column2.nunique()
Comment

pandas count distinct values in column

#column name ISSDTM
pd.to_datetime(df.ISSDTM, errors='coerce').dt.year

#result
0    2013
1    2013
2    2009
3    2009
Name: ISSDTM, dtype: int64 
Comment

PREVIOUS NEXT
Code Example
Python :: python sum comprehension 
Python :: gpu training tensorflow 
Python :: longest substring without repeating characters python 
Python :: python añadir elementos a una lista 
Python :: transparancy argument pyplot 
Python :: update windows wallpaper python 
Python :: tkinter clear entry 
Python :: python how to get every name in folder 
Python :: python print exception 
Python :: combine 2 dataframes based on equal values in columns 
Python :: count number of words in a string python 
Python :: type hint tuple 
Python :: mongodb check if substring in string 
Python :: Why do we use graphs? 
Python :: convert number to time python 
Python :: python csv add row 
Python :: string pattern matching pandas 
Python :: open csv file in python 
Python :: How can one find the three largest values of an input array efficiently, namely without having to sort the input array? 
Python :: registering static files in jango 
Python :: create a vector of zeros in r 
Python :: pygame.set_volume(2.0) max volume 
Python :: Make A Snake Game Using Python and Pygame 
Python :: how to read a .exe file in python 
Python :: how to install python libraries 
Python :: freq count in python 
Python :: python dataframe get numeric columns 
Python :: pandas search for nan in column 
Python :: import random py 
Python :: hide password input tkinter 
ADD CONTENT
Topic
Content
Source link
Name
9+2 =