Posts

Showing posts with the label data science python

Data Structures and Algorithms - Arrays (2)

Image
Array is a container which can hold a fix number of items and these items should be of the same type. Most of the data structures make use of arrays to implement their algorithms. Following are the important terms to understand the concept of Array. Element  − Each item stored in an array is called an element. Index  − Each location of an element in an array has a numerical index, which is used to identify the element. Array Representation Arrays can be declared in various ways in different languages. For illustration, let's take C array declaration. Arrays can be declared in various ways in different languages. For illustration, let's take C array declaration. As per the above illustration, following are the important points to be considered. Index starts with 0. Array length is 10 which means it can store 10 elements. Each element can be accessed via its index. For example, we can fetch an element at index 6 as 9. Basic Operations Following are the basic operations supported

Data Structures & Algorithms - Quick Guide (Step By Step) (1)

Image
  Overview Data Structure is a systematic way to organize data in order to use it efficiently. Following terms are the foundation terms of a data structure. Interface  − Each data structure has an interface. Interface represents the set of operations that a data structure supports. An interface only provides the list of supported operations, type of parameters they can accept and return type of these operations. Implementation  − Implementation provides the internal representation of a data structure. Implementation also provides the definition of the algorithms used in the operations of the data structure. Characteristics of a Data Structure Correctness  − Data structure implementation should implement its interface correctly. Time Complexity  − Running time or the execution time of operations of data structure must be as small as possible. Space Complexity  − Memory usage of a data structure operation should be as little as possible. Need for Data Structure As applications are gettin

Slicing of Numpy Arrays | Data Science tutorial| codin india

Image
Hello Friends, in this tutorial we will learn about what is indexing and slicing. Let us see one by one. What is indexing? Indexing is a term of defining something orderly. It is used when we want something in a specific range. Suppose you have multiple copies of the same item and you have to remember or recognize every item then you will give every item a unique name or number. That exactly what indexing is. In   Numpy Arrays   indexing start from 0 like   List   in   Python. EX:- myarr = np.array([101,102,103,104,105]) In the given example, the indexing start from zero. If I call the 3rd item from   myarr   array it will give me 104 from the array. What is slicing of array? Slicing of arrays indicates that calling the specific value or range of value from Array. Slicing of Array is almost the same as Slicing of string. We can fetch a specific value from the array, range of values from arrays, call values in reverse order and call value by jumping one or more element. You can slice ac