Keen Learner and Exp... • 23d
Day 6 of learning Data Science as a beginner. Topic: creating NumPy arrays NumPy arrays can be created using various ways one of them is using python list and converting it into a numpy array however this is a long way here you first create a python list and then use np(short form of numpy).array to convert that list into a numpy array this increases the unnecessary code lines and is also not very efficient. Some other way of creating a numpy array directly are: 1. np.zeros(): this will create an array full of zeros 2. np.ones(): this will create an array full of ones 3. np.full(): here you have to input the shape of the array and what integer you want to fill it with 4. np.eye(): this will create a matrix full of ones in main diagonal (aka identity matrix) 5. np.arange(): this works just like python's range function in for loop 6. np.linspace(): this creates an evenly spaced array you can also find the shape, size, datatype and dimension of arrays using .shape .size .dtype and .ndim functions of numpy. You can even reshape the array using .reshape function and can also change its datatype using .astype function. Numpy also offers a .flatten function which converts a 2D array to 1D. In short NumPy offers some really flexible options to create arrays effectively. Also here's my code and its result.


Keen Learner and Exp... • 21d
Day 7 of learning Data Science as a beginner. Topic: Indexing and Slicing NumPy arrays Since a past few days I have been learning about NumPy arrays I have learned about creating arrays from list and using other numpy functions today I learned abou
See More

Keen Learner and Exp... • 1m
Day 12 of learning AI/ML as a beginner. Topic: TF-IDF practical. Yesterday I shared my theory notes and today I have done the practical of TF-IDF. For the practical I reused my spam classifier code and for TF-IDF I first imported it from the sklear
See More

Front-end Developer • 1y
#Array in #javascript: Array in Javascript enables storing a collection of multiple items under a single variable name, and has members for performing common array operations. Arrays aren't primitives but are instead Array #objects with the followin
See More



Keen Learner and Exp... • 15d
Day 9 of learning Data Science as a beginner. Topic: Data Types & Broadcasting NumPy offers various data types for a variety of things for example if you want to store numerical data it will be stored in int32 or int64 (depending on your system's a
See More

Keen Learner and Exp... • 24d
Day 5 of learning Data Science as a beginner Topic: Using NumPy in Data Science Python despite having much advantages (like being beginner friendly, easy to read) is also famous for its one limitation i.e. it is slow. We don't really feel much abou
See More



Download the medial app to read full posts, comements and news.