Numpy Ndarray

A PHP Error was encountered

Severity: Warning

Message: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.

Filename: blog/post_details.php

Line Number: 38

Backtrace:

File: /home/solutio1/public_html/application/views/blog/post_details.php
Line: 38
Function: strtotime

File: /home/solutio1/public_html/application/controllers/Blog.php
Line: 14
Function: view

File: /home/solutio1/public_html/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.

Filename: blog/post_details.php

Line Number: 38

Backtrace:

File: /home/solutio1/public_html/application/views/blog/post_details.php
Line: 38
Function: date

File: /home/solutio1/public_html/application/controllers/Blog.php
Line: 14
Function: view

File: /home/solutio1/public_html/index.php
Line: 315
Function: require_once

2019-08-19
Omsingh Bais

Numpy Ndarray

 

Ndarray is The n-dimensional array object defined in the numpy is ndarray which stores the collection of the similar type of elements. 

An item in an ndarray takes the same size of block in the memory. The ndarray object can be accessed by using the 0 based indexing.

Creating a ndarray :

x = numpy.array

Before creating the ndarraay make sure that the numpy module is installed and imported into the program. If not install then check this article (Installation-of-numpy).

import numpy as np
x =  np.array()
print(x)

The above code will create the empty  n-dimensional array. We can also pass the parameters in the array  to create the equivalent n-dimensional array, Use following syntax.

numpy.array(object, dtype = None, copy = True, order = None, subok = False, ndmin = 0)  

Following are the in-details use of parameters.

Sr No. Parameter Description
1 object  It represents the object. It can be a list, dictionary, set, tuple etc.
2 dtype  The dtype parameter is used for changing data type. e.g float, int,     complex etc
3 copy  By default it is true and optional. Which means the object is copied.
4 order  Order can be C (column), R (row), or A (any)(default)
5 subok  It returned base class array by default. We can change it option to true so   it will passes through subclasses.
6 ndmin  Ndmin means minimum dimensions of the resulting array.

 

Following are the some example to creating ndarray.

  • creating array using list
import numpy as np 
x = np.array([11,25,48]) 
print (x)

Output :

[11, 25, 48]

 

For in-depth opertaion of ndarray check this article ( Numpy-Ndarray-Operation)

 

Happy coding....

 

  • Please give your suggestion if you find anything incorrect. Contact us at team@solutionstouch.com


About author

Card image cap
Omsingh Bais

Having more than 1+ year experience in the data scientist domain.!

-Data Scientist

0 Comments