Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • Python_ToolBox Python_ToolBox
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • Marie Brunel
  • Python_ToolBoxPython_ToolBox
  • Wiki
  • Numpy array

Last edited by Marie Brunel Feb 10, 2022
Page history

Numpy array

Numpy array

initialisation

array = np.zeros((4,4))

mask

# mask when value = 0
data = ma.masked_where(data == 0, data)

#test if masked value
np.ma.is_masked()

divide two array

a = np.array([-1, 0, 1, 2, 3], dtype=float)
b = np.array([ 0, 0, 0, 2, 2], dtype=float)
# If you don't pass `out` the indices where (b == 0) will be uninitialized!
c = np.divide(a, b, out=np.zeros_like(a), where=b!=0)
[0.  0.  0.  1.  1.5]

isnan

np.isnan()
Clone repository
  • Binary file
  • Brazil
  • C balance abnormally high in LPJmL 5 running @LAM
  • Cluster
  • Color and ColorMap
  • Data treatment
  • Link shelf
  • Morocco
  • NetCDF format and file
  • Numpy array
  • Plot graph and map
  • Python script
  • Run CNRM and HADgem LPJmL5 (30 minutes)
  • Home