# python-scipyHow can I use the x.shape function in Python Numpy?

The `x.shape`

function is a part of the NumPy library in Python and is used to find the shape of an array. It returns a tuple of the form `(rows, columns)`

, where `rows`

is the number of rows and `columns`

is the number of columns in the array.

## Example

```
import numpy as np
x = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
x.shape
```

## Output example

`(3, 3)`

The code above imports NumPy as `np`

and creates an array `x`

with three rows and three columns. Then the `x.shape`

function is used to find the shape of the array `x`

, which is `(3, 3)`

.

## Code explanation

`import numpy as np`

: imports the NumPy library and assigns it to the alias`np`

`np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])`

: creates an array`x`

with three rows and three columns`x.shape`

: finds the shape of the array`x`

## Helpful links

### More of Python Scipy

- How can I use the Radial Basis Function (RBF) in Python with SciPy?
- How do I create a 2D array of zeros using Python and NumPy?
- How do I use Python XlsxWriter to write a NumPy array to an Excel file?
- How do I create a numpy array of zeros using Python?
- How can I use Python and Numpy to parse XML data?
- How do I create a zero matrix using Python and Numpy?
- How do I create a numpy array of zeros using Python?
- How do I create an array of zeros with the same shape as an existing array using Python and NumPy?
- How can I use Python and Numpy to zip files?
- How can I use Python and SciPy to find the zeros of a function?

See more codes...