Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • Data preprocessing
  • Data Manipulation
  • Data Analysis using Pandas
  • EDA
  • Pandas Exercise
  • Pandas AI
  • Numpy
  • Matplotlib
  • Plotly
  • Data Analysis
  • Machine Learning
  • Data science
Open In App
Next Article:
Python | Numpy MaskedArray.__ior__()
Next article icon

Python | Numpy MaskedArray.__iand__()

Last Updated : 23 Apr, 2019
Comments
Improve
Suggest changes
Like Article
Like
Report

numpy.ma.MaskedArray class is a subclass of ndarray designed to manipulate numerical arrays with missing data. With the help of Numpy MaskedArray.__iand__we can get the elements that is anded by the value that is provided as a parameter in the MaskedArray.__iand__() method.

Syntax: numpy.MaskedArray.__iand__($self, value, /)

Return: Return self&=value.

Example #1 :
In this example we can see that every element is anded by the value that is passed as a parameter in MaskedArray.__iand__() method.




# import the important module in python 
import numpy as np 
      
# make an array with numpy 
gfg = np.ma.array([1, 2, 3, 4, 5]) 
      
# applying MaskedArray.__iand__() method 
print(gfg.__iand__(2)) 
  
 
 
Output:
  [0 2 2 0 0]  

 
Example #2:




# import the important module in python 
import numpy as np 
      
# make an array with numpy 
gfg = np.ma.array([[1, 2, 3, 4, 5], 
                [6, 5, 4, 3, 2]]) 
      
# applying MaskedArray.__iand__() method 
print(gfg.__iand__(1)) 
 
 
Output:
  [[1 0 1 0 1]   [0 1 0 1 0]]  


Next Article
Python | Numpy MaskedArray.__ior__()

S

Shivam_k
Improve
Article Tags :
  • Python
  • Python numpy-ndarray
  • Python-pandas
Practice Tags :
  • python

Similar Reads

  • Python | Numpy MaskedArray.__and__
    numpy.ma.MaskedArray class is a subclass of ndarray designed to manipulate numerical arrays with missing data. With the help of Numpy MaskedArray.__and__ method we can get the elements that is anded by the value that is provided as a parameter. Syntax: numpy.MaskedArray.__and__ Return: Return self
    1 min read
  • Python | Numpy MaskedArray.__add__
    numpy.ma.MaskedArray class is a subclass of ndarray designed to manipulate numerical arrays with missing data. With the help of Numpy MaskedArray.__add__ we can add a particular value that is provided as a parameter in the MaskedArray.__add__() method. Value will be added to each and every element i
    1 min read
  • Python | Numpy MaskedArray.__ior__()
    numpy.ma.MaskedArray class is a subclass of ndarray designed to manipulate numerical arrays with missing data. With the help of Numpy MaskedArray.__ior__we can get the elements that is OR by the value that is provided as a parameter in the MaskedArray.__ior__() method. Syntax: numpy.MaskedArray.__io
    1 min read
  • Python | Numpy MaskedArray.__abs__
    numpy.ma.MaskedArray class is a subclass of ndarray designed to manipulate numerical arrays with missing data. With the help of Numpy MaskedArray.__abs__ operator we can find the absolute value of each and every element in an array. Suppose we have a values 31.74, with the help of MaskedArray.__abs_
    1 min read
  • Python | Numpy MaskedArray.__div__
    numpy.ma.MaskedArray class is a subclass of ndarray designed to manipulate numerical arrays with missing data. With the help of Numpy MaskedArray.__div__ we can divide a particular value that is provided as a parameter in the MaskedArray.__div__() method. Syntax: numpy.MaskedArray.__div__ Return: Di
    1 min read
  • Python | Numpy MaskedArray.__ixor__()
    numpy.ma.MaskedArray class is a subclass of ndarray designed to manipulate numerical arrays with missing data. With the help of Numpy MaskedArray.__ixor__we can get the elements that is XOR by the value that is provided as a parameter in the MaskedArray.__ixor__() method. Syntax: numpy.MaskedArray._
    1 min read
  • Python | Numpy MaskedArray.__divmod__
    numpy.ma.MaskedArray class is a subclass of ndarray designed to manipulate numerical arrays with missing data. With the help of Numpy MaskedArray.__divmod__ we will get two arrays one is having elements that is divided by value that is provided in numpy.ma.__divmod__() method and second is having el
    2 min read
  • Python | Numpy MaskedArray.__eq__
    numpy.ma.MaskedArray class is a subclass of ndarray designed to manipulate numerical arrays with missing data. With the help of Numpy MaskedArray.__eq__ operator we can find that which element in an array is equal to the value which is provided in the parameter. Syntax: numpy.MaskedArray.__eq__ Retu
    1 min read
  • Python | Numpy MaskedArray.__ge__
    numpy.ma.MaskedArray class is a subclass of ndarray designed to manipulate numerical arrays with missing data. With the help of Numpy MaskedArray.__ge__ operator we can find that which element in an array is greater than or equal to the value which is provided in the parameter. Syntax: numpy.MaskedA
    1 min read
  • Python | Numpy MaskedArray.__lt__
    numpy.ma.MaskedArray class is a subclass of ndarray designed to manipulate numerical arrays with missing data. With the help of Numpy MaskedArray.__lt__ operator we can find that which element in an array is less than the value which is provided in the parameter. Syntax: numpy.MaskedArray.__lt__ Ret
    1 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences