GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — add flags attribute and thier sub attributes program · deepdalsania/tutorials@55eff24

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • python-numpy/Python_NumPy/npbasic
    • AttributeNpFlags.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎python-numpy/Python_NumPy/npbasic/AttributeNpFlags.py‎

Copy file name to clipboard
+24Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import numpy as np
2+
3+
# Information about the memory layout of the array.
4+
5+
# The flags object can be accessed dictionary-like (as in a.flags['WRITEABLE']), or by using
6+
# lowercased attribute names (as in a.flags.writeable). Short flag names are only supported
7+
# in dictionary access.
8+
9+
a = np.arange(10)
10+
# The data is in a single, C-style contiguous segment
11+
print("Flags Attribute C_CONTIGUOUS : ",a.flags.c_contiguous)
12+
# The data is in a single, Fortran-style contiguous segment
13+
print("Flags Attribute F_CONTIGUOUS : ",a.flags.f_contiguous)
14+
# The array owns the memory it uses or borrows it from another object
15+
print("Flags Attribute OWNDATA : ",a.flags.owndata)
16+
# The data area can be written to. Setting this to False locks the data, making it read-only
17+
print("Flags Attribute WRITEABLE : ",a.flags.writeable)
18+
# The data and all elements are aligned appropriately for the hardware
19+
print("Flags Attribute ALIGNED : ",a.flags.aligned)
20+
# This array is a copy of some other array. When this array is deallocated, the base array
21+
# will be updated with the contents of this array
22+
print("Flags Attribute WRITEBACKIFCOPY : ",a.flags.writebackifcopy)
23+
24+

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.