Skip to main content

Posts

Showing posts from June, 2021

Codechef ATM Problem Solve in Python

  Codechef --- ATM Problem Solve in Python Pooja would like to withdraw X $US from an ATM . The cash machine will only accept the transaction if X is a multiple of 5, and Pooja's account balance has enough cash to perform the withdrawal transaction (including bank charges). For each successful withdrawal, the bank charges 0.50 $US. Calculate Pooja's account balance after an attempted transaction. Ex. - Positive integer 0 < X <= 2000 - the amount of cash which Pooja wishes to withdraw. Nonnegative number 0<= Y <= 2000 with two digits of precision - Pooja's initial account balance. Example - Successful Transaction Input: 30 120.00 Output: 89.50 Code :-- total_amount = 120 #int(input("Enter your total avalable account balence:-- ")) cash_withdr = 30 #int(input("How much money do you want :-- ")) check_amount = cash_withdr * 4 if check_amount <= total_amount: now_balence = float(((total_amount - cash_withdr) - 0.50)) print(&

10 Reasons Why Python is so much in Demand?

  10 Reasons Why Python is so much in Demand? Python is one of the most prevalent programming languages. It is highly user-friendly and an open-source language. Python is not only growing its popularity but also enhancing its applications in almost every field.  Python is one of the most prevalent programming languages. It is highly user-friendly and an open-source language. Python is not only growing its popularity but also enhancing its applications in almost every field. 1. Python has Simple Syntax Python language is very simple and easy to handle. It has a very easy and user-friendly syntax. It is not too difficult to code in Python because of its syntax. Its syntax is somewhat similar to that of the English Language. It does not have complicated syntax as other languages. You can code in Python even without having in-depth knowledge of Python . It does not even require any braces; it just works on indentation. 2. Python has an Abundance of Libraries and Frameworks It consists of

Python Libraries a Data Scientist must know

  Top 21 Python Libraries a Data Scientist must know Python is an   abundant source   of   libraries . A Python library is a gathering of  functions  that assist one to  perform many actions . It has  myriad inbuilt   libraries . Python contains ample libraries for  data science . This tutorial covers  Python libraries  for a data scientist. 1. Data Cleaning and Data Manipulation Pandas NumPy Spacy SciPy 2. Data Gathering Beautiful Soap Scrapy Selenium 3. Data Visualisation Matplotlib Seaborn Bokeh Plotly 4. Data Modelling Scikit-Learn PyTorch TensorFlow Theano 5. Image Processing Scikit-Image Pillow OpenCV 6. Audio Processing pyAudioAnalysis Librosa Madmom

why we use Numpy in python

  why we use NumPy in python NumPy  is a general-purpose array-processing package. It provides a high-performance multidimensional array object and tools for working with these arrays. It is the fundamental package for scientific computing with  Python .  A powerful N-dimensional array object. Syntex:-   import  numpy arr = numpy.array([ 1 ,  2 ,  3 ,  4 ,  5 ]) print (arr)     Output:-   [1 2 3 4 5] NumPy  is a basic level external library in Python  used  for complex mathematical operations.  NumPy  overcomes slower executions with the  use  of multi-dimensional array objects. It has built-in functions for manipulating arrays. We can convert different algorithms to can into functions for applying on arrays.   NumPy  arrays are faster and more compact than Python lists. An array consumes less memory and is convenient to  use .  NumPy uses  much less memory to store data and it provides a mechanism of specifying the data types.

Elon Musk

  Elon Musk Elon Musk   (born June 28, 1971,  Pretoria , South Africa), South African-born American  entrepreneur  who cofounded the electronic-payment firm  PayPal  and formed  SpaceX , maker of launch vehicles and spacecraft. He was also one of the first significant investors in, as well as chief executive officer of, the  electric car  manufacturer Tesla. Early life Musk was born to a South African father and a Canadian mother. He displayed an early talent for computers and entrepreneurship. At age 12 he created a video game and sold it to a computer magazine. In 1988, after obtaining a Canadian passport, Musk left South Africa because he was unwilling to support apartheid through compulsory military service and because he sought the greater economic opportunities available in the United States. PayPal and SpaceX Musk attended Queen’s University in Kingston, Ontario, and in 1992 he transferred to the University of Pennsylvania, Philadelphia, where he received bachelor’s degrees in p

Linear Search

 Linear Search Linear search is a very simple search algorithm. In this type of search, a sequential search is made over all items one by one. Every item is checked and if a match is found then that particular item is returned, otherwise the search continues till the end of the data collection. Linear Search Program def linear_search(list,target):     for i in range(0,len(list)):         if list[i] == target:             return i     return None def verify(index):     if index is not None:         print("Target found at index: ",index)     else:         print("Target not found in index")          numbers = [1,2,3,4,5,6,7,8,9,10]  result=linear_search(numbers,7) verify(result) Output:-    Target found at index: 6

Difference between loc() and iloc() in Pandas DataFrame

  Difference between loc() and iloc() in Pandas DataFrame Pandas library of python is very useful for the manipulation of mathematical data and is widely used in the field of machine learning. It comprises many methods for its proper functioning.  loc()  and  iloc()  are one of those methods. These are used in slicing data from the Pandas DataFrame. They help in the convenient selection of data from the DataFrame. They are used in filtering the data according to some conditions. The working of both of these methods is explained in the sample dataset of cars. loc()  :  loc()  is label-based data selecting method which means that we have to pass the name of the row or column which we want to select. This method includes the last element of the range passed in it, unlike  iloc() .  loc()   can accept the boolean data unlike  iloc()  .  iloc() :  iloc( )  is an indexed-based selecting method which means that we have to pass integer index in the method to select a specific row/column. This

What is Data Science?

  What is Data Science? Data Science is about data gathering, analysis, and decision-making. Data Science is about finding patterns in data, through analysis, and make future predictions. By using Data Science , companies are able to make: Better decisions (should we choose A or B) Predictive analysis (what will happen next?) Pattern discoveries (find a pattern, or maybe hidden information in the data) How Does a Data Scientist Work? A Data Scientist requires expertise in several backgrounds: Machine Learning Statistics Programming (Python or R) Mathematics Databases A Data Scientist must find patterns within the data. Before he/she can find the patterns, he/she must organize the data in a standard format. Here is how a Data Scientist works: Ask the right questions  - To understand the business problem.                  Explore and collect data  - From the database, weblogs, customer feedback, etc.                                                                                  Extrac

What is Intelligence?

  What is Intelligence? The ability of a system to calculate, reason, perceive relationships and analogies, learn from experience, store and retrieve information from memory, solve problems, comprehend complex ideas, use the natural language fluently, classify, generalize, and adapt to new situations. Basic Concept of Artificial Intelligence (AI) According to the father of Artificial Intelligence , John McCarthy, it is “The science and engineering of making intelligent machines, especially intelligent computer programs”. Artificial Intelligence is a way of making a computer, a computer-controlled robot, or software think intelligently, in the similar manner the intelligent humans think. AI is accomplished by studying how the human brain thinks and how humans learn, decide, and work while trying to solve a problem, and then using the outcomes of this study as a basis for developing intelligent software and systems. While exploiting the power of the computer systems, the curiosity of hum

What is Python?

  What is Python? Python   is a general-purpose interpreted, interactive, object-oriented, and high-level programming language. It was created by Guido van Rossum during 1985- 1990. Like Perl, Python source code is also available under the GNU General Public License (GPL). This   tutorial   gives enough understanding of  the  Python programming   language. Why Learn Python? Python  is a high-level, interpreted, interactive, and object-oriented scripting language. Python is designed to be highly readable. It uses English keywords frequently whereas other languages use punctuation, and it has fewer syntactical constructions than other languages. Python   is a MUST for students and working professionals to become great Software Engineers especially when they are working in Web Development Domain. I will list down some of the key advantages of learning Python : Python is Interpreted  − Python is processed at runtime by the interpreter. You do not need to compile your program before execut