CBSE CS and IP

CBSE Class 11 & 12 Computer Science and Informatics Practices Python Materials, Video Lecture

Pandas Series Methods

  • As we all know everythin in python is Object. Every Object has some Methods and Attributes.
       Methods - Functions (Ex:- add() )
       Attributes - Properties (Ex:- dtype )

  • Assueme if we have created a Series s, then the Methods and Attributes will be used with s as follows.
       Methods - s.add()
       Attributes - s.dtype

  • Methods used with small brackets [ () ], but the attributes will not be used with brackets.

  • Following are the important methods of Series.

Click on them to find how to use them with example (After opening the link find the Series examples) :

  1. abs( ) : Return a Series/DataFrame with absolute numeric value of each element.
  2. add( ) : Return Addition of series and other, element-wise 
  3. div( ) : Return Floating division of series and other, element-wise 
  4. sub( ) : Return Subtraction of series and other, element-wise 
  5. sum( ) : Return the sum of the values for the requested axis. 
  6. floordiv( ) : Return Integer division of series and other, element-wise 
  7. equals( ) : Test whether two objects contain the same elements. 
  8. all( ) : Return whether all elements are True, potentially over an axis. 
  9. append( ) : Concatenate two or more Series. 
  10. astype( ) : Cast a pandas object to a specified dtype. 
  11. copy( ) : Make a copy of this object’s indices and data. 
  12. describe( ) : Generate descriptive statistics. 
  13. drop( ) : Return Series with specified index labels removed. 
  14. drop_duplicates( ) : Return Series with duplicate values removed. 
  15. dropna( ) : Return a new Series with missing values removed. 
  16. fillna( ) : Fill NA/NaN values using the specified method. 
  17. replace( ) : Replace values given in to_replace with value. 
  18. rename( ) : Alter Series index labels or name. 
  19. reindex( ) : Conform Series to new index with optional filling logic. 
  20. reindex_like( ) : Return an object with matching indices as other object. 
  21. rename_axis( ) : Set the name of the axis for the index or columns. 
  22. where( ) : Replace values where the condition is False. 
  23. max( ) : Return the maximum of the values for the requested axis. 
  24. min( ) : Return the minimum of the values for the requested axis. 
  25. mean( ) : Return the mean of the values for the requested axis. 
  26. median( ) : Return the median of the values for the requested axis. 
  27. std( ) : Return sample standard deviation over requested axis. 
  28. var( ) : Return unbiased variance over requested axis. 
  29. count( ) : Return number of non-NA/null observations in the Series. 
  30. agg( ) : Aggregate using one or more operations over the specified axis.


No comments:

Post a Comment