If you want to quickly start working on python by learning end to end of basics, you are at the right place. I am using the Jupyter notebook for the purpose of this exercise. We can get the Jupyter notebook by downloading and installing anaconda from the link, which is a open-source distribution of Python. If you are new to Jupyter notebook please go through this nice blog which explains how to launch it and use. With that being said lets start the work.
Below is he list of 20 topics we quickly go through.
This post is all about teaching AI how to play a simple game which I built using pygame library. The game is, the ball should keep on rolling through the gap between the pipes, if the ball hits any of the pipe then we lose. As and when a ball successfully passes through the gap between the pipes, the score will be increased by 1.
The Gif image above shows the training process of how neural network improves generation after generation and the progress status can be seen the in game window using the below three values.
Neural networks require their input to be a fixed number of columns. This input format is very similar to spreadsheet data. This input must be entirely numeric.
It is essential to represent the data in a way that the neural network can train from it. In class 6, we will see even more ways to preprocess data. For now, we will look at several of the most basic ways to transform data for a neural network.
Character Data (strings)
Map and reduce are two functions that apply a task that you create to a data frame. Pandas supports functional programming techniques that allow you to use functions across en entire data frame. Pandas also provides several standard functions for use with data frames.
The map function allows you to transform a column by mapping certain values in that column to other values. Consider the Auto MPG data set that contains a field origin_name that holds a value between one and three that indicates the geographic origin of each car. …
There may be information lurking in the order of the rows of your dataset. Unless you are dealing with time-series data, the order of the rows should not be significant. Consider if your training set included employees in a company. Perhaps this dataset is ordered by the number of years that the employees were with the company. It is okay to have an individual column that specifies years of service. However, having the data in this order might be problematic.
Consider if you were to split the data into training and validation. You could end up with your validation set…
Pandas is an open-source library providing high-performance, easy-to-use data structures and data analysis tools for the Python programming language. It is based on the dataframe concept found in the R programming language.
Took the auto mpg dataset from the StatLib library. The following code loads the MPG dataset into a data frame: It contains data for 398 cars, including mpg, cylinders), displacement, horsepower , weight, acceleration, model year, origin and the car’s name.
Functions, lambdas, and map/reduce can allow you to process your data in advanced ways. We will introduce these techniques here and expand on them in the next module, which will discuss Pandas.
Function parameters can be named or unnamed in Python. Default values can also be used. Consider the following function.
There are many different types of files that we can process. Some of these file types are listed here:
Lists and tuples are very similar in Python and are often confused. The significant difference is that a list is mutable, but a tuple isn’t. …
Basics of Python — Hello World, Print Statements, If and For loops..
Pytho is a popular general-purpose programming language. It was created by Guido van Rossum, and released in 1991.
It is used for:
I have used Jupyter notebook for running the python scripts and version is 3.6. Hope you are aware of installing python and Jypyter notebooks. You can use other IDLEs which you are comfortable with. Lets dive into coding and start with the very basics.
The below code passes a constant string, containing the text “hello world”…