Keen Learner and Exp... • 2d
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... • 14h
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 MoreKeen Learner and Exp... • 26d
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 MoreFront-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 MoreFull-time Freelancer... • 1y
Most Javascript Questions Asked in Interview | PART 2 1. What is difference between a for loop and for Each loop Ans: A for loop is traditional loop that uses a counter variable to iterate over an array. ForEach loop is a method that iterate over a
See MoreI'm a pro medialist • 2m
Non-programmers using AI to create apps is "vibe coding". The generated apps appear to work, but they may not function as intended in all cases. Furthermore, apps shouldn't only function properly but also be secure: you shouldn't make your users' da
See MoreDownload the medial app to read full posts, comements and news.