Posts

Showing posts with the label libraries

NumPy

Image
NumPy is a python library used for applying high-level mathematical functions to multi-dimensional arrays and matrices. In our case it would help us in vectorization. Vectorization refers to the solution which allow the application of operations to an entire set of arrays at once instead of applying it one element at a time (as is done in case of loops) Vectorization is much much faster than the traditional loops and most computer can do it more efficiently ( Here is a sample of code to demonstrate just how fast it is) But before we start with matrices and vectorization and broadcasting and what not, let's start with the very basics and learn how to make and modify matrices NumPy is usually enabled by default, nevertheless. You can check check it from the Anaconda Navigator   (if you don't know about Anaconda Navigator and don't know how to install packages, check the following link ) Now, Open Jupyter notebooks, go to whatever folder you want to save the file in and let&#

Intro to Pandas

Image
By Marc Garcia - https://github.com/pandas-dev/pandas/blob/master/web/pandas/static/img/pandas.svg, BSD, https://commons.wikimedia.org/w/index.php?curid=73107397 Pandas is a Python Library used to store and manipulate tabular data. This is an essential library that we'll use in the future (and quite frequently so) to manipulate our data for predictions, classifications and what not. So, without further ado, let's jump right into it. Let us first download our data, that we will use to practice all the features and functions of library. Go to https://www.kaggle.com/sohier/calcofi    It should direct you to this page: Click on the "Download" button right beside the "New Notebook". It'll download a zipped file. (Save the zipped file somewhere in the C drive)  Extract that to your desired folder (Also, somewhere in C drive). I put the folder here : Now open "Anaconda Navigator" and download pandas packag