Numpy.c_ — NumPy V1.23 Manual

Skip to main content Back to top Ctrl+K
  • User Guide
  • API reference
  • Building from source
  • Development
  • Release notes
  • Learn
  • NEPs
Choose version
  • GitHub

Section Navigation

  • NumPy’s module structure
  • Array objects
  • Universal functions (ufunc)
  • Routines and objects by topic
    • Constants
    • Array creation routines
    • Array manipulation routines
    • Bit-wise operations
    • String functionality
    • Datetime support functions
    • Data type routines
    • Mathematical functions with automatic domain
    • Floating point error handling
    • Exceptions and Warnings
    • Discrete Fourier Transform
    • Functional programming
    • Input and output
    • Indexing routines
      • numpy.c_
      • numpy.r_
      • numpy.s_
      • numpy.nonzero
      • numpy.where
      • numpy.indices
      • numpy.ix_
      • numpy.ogrid
      • numpy.ravel_multi_index
      • numpy.unravel_index
      • numpy.diag_indices
      • numpy.diag_indices_from
      • numpy.mask_indices
      • numpy.tril_indices
      • numpy.tril_indices_from
      • numpy.triu_indices
      • numpy.triu_indices_from
      • numpy.take
      • numpy.take_along_axis
      • numpy.choose
      • numpy.compress
      • numpy.diag
      • numpy.diagonal
      • numpy.select
      • numpy.place
      • numpy.put
      • numpy.put_along_axis
      • numpy.putmask
      • numpy.fill_diagonal
      • numpy.nditer
      • numpy.ndenumerate
      • numpy.ndindex
      • numpy.nested_iters
      • numpy.flatiter
      • numpy.iterable
    • Linear algebra
    • Logic functions
    • Masked array operations
    • Mathematical functions
    • Miscellaneous routines
    • Polynomials
    • Random sampling
    • Set routines
    • Sorting, searching, and counting
    • Statistics
    • Test support
    • Window functions
  • Typing (numpy.typing)
  • Packaging
  • NumPy C-API
  • Array API standard compatibility
  • CPU/SIMD optimizations
  • Thread Safety
  • Global Configuration Options
  • NumPy security
  • Testing guidelines
  • Status of numpy.distutils and migration advice
  • numpy.distutils user guide
  • NumPy and SWIG
  • NumPy reference
  • Routines and objects by topic
  • Indexing routines
  • numpy.c_
numpy.c_# numpy.c_=<numpy.lib._index_tricks_impl.CClass object>#

Translates slice objects to concatenation along the second axis.

This is short-hand for np.r_['-1,2,0', index expression], which is useful because of its common occurrence. In particular, arrays will be stacked along their last axis after being upgraded to at least 2-D with 1’s post-pended to the shape (column vectors made out of 1-D arrays).

See also

column_stack

Stack 1-D arrays as columns into a 2-D array.

r_

For more detailed documentation.

Examples

Try it in your browser! >>> importnumpyasnp >>> np.c_[np.array([1,2,3]), np.array([4,5,6])] array([[1, 4], [2, 5], [3, 6]]) >>> np.c_[np.array([[1,2,3]]), 0, 0, np.array([[4,5,6]])] array([[1, 2, 3, ..., 4, 5, 6]]) Go BackOpen In Tab On this page
  • c_

Từ khóa » Np-c