Showing posts with the label List

Featured Post

The Quick and Easy Way to Analyze Numpy Arrays

The quickest and easiest way to analyze NumPy arrays is by using the numpy.array() method. This method allows you to quickly and easily analyze the values contained in a numpy array. This method can also be used to find the sum, mean, standard deviation, max, min, and other useful analysis of the value contained within a numpy array. Sum You can find the sum of Numpy arrays using the np.sum() function.  For example:  import numpy as np  a = np.array([1,2,3,4,5])  b = np.array([6,7,8,9,10])  result = np.sum([a,b])  print(result)  # Output will be 55 Mean You can find the mean of a Numpy array using the np.mean() function. This function takes in an array as an argument and returns the mean of all the values in the array.  For example, the mean of a Numpy array of [1,2,3,4,5] would be  result = np.mean([1,2,3,4,5])  print(result)  #Output: 3.0 Standard Deviation To find the standard deviation of a Numpy array, you can use the NumPy std() function. This function takes in an array as a par

How to Find Max and Min Quickly in Python List

Here's logic to find Max and Min values in a List. Without using built-in Max() and Min () functions you can find Max and Min values in a List. For that matter, you need to write a user-defined function. This post is all about how to write it and run. Finding Max and Min in List You can achieve this by writing a user-defined function. Here's useful logic and steps to write it precisely. IN THIS PAGE Write a Function Execute Function Get the result Write Function You can write an user-defined function to get MAX and MIN values. In this function, I am using the max(), min() built-in functions. The other variables you can use as you wish. Below is the my actual logic. Sample Code def findmaxmin (data): ax = max (data) by = min (data) return (x,y) data = ( 109 , 98 , 88 , 7 ) (maximum, minimum) = findmaxmin (data) print ( "Maximum Marks = " , maximum) print ( "Minimum Marks = " , minimum) Created a Script Using vim editor Here as the first step, I

6 Exclusive List and Tuple Differences in Python

Here're the quick differences between Tuple and List in Python. These are helpful for interviews and your project. Tuple and List differences List Comma-separated elements inside a square bracket [] make a list. The elements are indexed, which starts from '0' These you need to enclose in a single quote and separate by a comma. It can contain another list, which is called a NESTED list. Use type() function to get the type of data it is. The list is mutable (you can change the data). The objects (elements) can be of different data types.  Here're  examples on the List. Tuple The elements comma-separated and enclosed in parenthesis ()  The elements are indexed, which starts from '0' It can have heterogeneous data (integer, float, string, list, etc.) It is immutable. So you can't change the elements. Use the type() function to get the type of data it is.  Here're  examples of Tuple. List Example #Illustration of creating a list  new_list=[1, 2, 3, 4]  print(

Top Data Science Tools Complete List

Top data science tools and platform providers across the world. Useful information for data science and data analytics developers. 8 Top Data Analytics Tools List. Data Science is a combination of multiple skills. AI and Machine Learning are part of data science. You can create AI and Machine Learning products with data. Related Posts Top Skills You Need for Data Science Career Data Science Sample Project an Example