python

Python iloc, loc, ix Data Retrieving Selection Functions
|

Python iloc, loc, ix Data Retrieving Selection Functions

  Pandas iloc, loc, and ix functions are very powerful ways to quickly select data from your dataframe. Today , we take a quick look at these 3 functions. Credits to Data School, you can check him out in Youtube  In [1]: import pandas as pd   In [2]: #lets get this public dataset and play with it…

Natural Language Processing Machine Learning Algorithm Model Python – NLP
| |

Natural Language Processing Machine Learning Algorithm Model Python – NLP

In this guide, we take a look at Natural Language Processing, NLP in Python. Natural Language is a very extensive topic and very powerful machine learning algorithm you can build. This is very useful in many areas of most industries. Credits to Jose Portilla, creator of Learning Python for Data Analysis and Visualization course   on Udemy  …

|

Create Batch Dot Bat File to Run Your Python Script With Windows Scheduler

After writing your script, you might want to schedule it to run periodically, let’s say, Daily, Weekly or Any Time interval you will decide Before you schedule that you want to  simply create a batch file and schedule it run with a Windows Scheduler. Here are simple steps to do that. First of all, if…

Simple Python Logging Callling Reload to Help Save Logging to File

Simple Python Logging Callling Reload to Help Save Logging to File

  In this notes, we are looking at a simple but yet useful and powerful logging in Python In [77]: import logging #levels of logging are #1 debug – detailed info #2 info – confirmation that things went according to plan #3 warning – something unexpected happened #4 error – some function failed #5 critical -…

Getting Stock Prices from Yahoo and plotting Python 3 Matplolib Urllib

This is  some quick notes about getting stock data from Yahoo and plotting it using Matplotlib . The Python version used is Python 3.5 Credits to sentdex.  You can check him out on Youtube. In [11]: import matplotlib.pyplot as plt import numpy as np import urllib import matplotlib.dates as mdate import urllib.request %matplotlib inline #%matplotlib qt #%matplotlib notebook…

Matplotlib Pyplot Plt Python Pandas Data Visualization Plotting

Matplotlib Pyplot Plt Python Pandas Data Visualization Plotting

  This is some quick notes about graphing or plotting graphs with Matplotlib in Python. Credits to sentdex.  You can check him out on Youtube. import matplotlib.pyplot as plt %matplotlib inline # simple syntax is matplotlib plots as plt.plot(x, y) plt.plot([1,2,3], [5,6,7]) plt.show()   In [4]: # plotting with variables and basic labelling of our plot x = [1,2,3]…

ImportError: No module named learn.base Crab Python Fix

ImportError: No module named learn.base Crab Python Fix

I was working on Recommender System and had a problem when i tried importing from scikits.crab.recommenders.knn import UserBasedRecommender. I encountered the following error ImportError: No module named learn.base I did research on the web and found one good solution but it was in Chinese. Here is the link and credit to the original fixer :…

ImportError: No module named ‘scikits’ – Python Fix Jupyter Notebook

ImportError: No module named ‘scikits’ – Python Fix Jupyter Notebook

If you have the above problem, to fix this, follow these guidelines as advised by Flowerowl  at this link (https://github.com/muricoca/crab/issues/92): The steps are as follows:   Don’t install crab in this way: pip install crab / easy_install crab You can find crab in pypi.python.org, this is not our scikits.crab source Solution: git clone https://github.com/muricoca/crab.git python setup.py…

Array Processing – Python Numpy – How to work with Arrays in Python

  Hi Guys, Thanks for all your emails. In this note, we will be looking at Array Processing in Python. This is part of lectures on Learning Python for Data Analysis and Visualization by Jose Portilla on Udemy. In [3]: import numpy as np import matplotlib.pyplot as plt %matplotlib inline   In [4]: points = np.arange(-5,5,0.01)   In [5]: dx, dy…

Aggregation – Pandas Numpy Python Series DataFrame

  In this quick notes, we will go through aggregation in Python. This is part of lectures on Learning Python for Data Analysis and Visualization by Jose Portilla on Udemy. import numpy as np import pandas as pd from pandas import Series, DataFrame   url = “http://archive.ics.uci.edu/ml/machine-learning-databases/wine-quality/” In [2]: dframe_wine = pd.read_csv(‘winequality-red.csv’, sep=’;’)   In [4]: dframe_wine.head()   Out[4]: fixed…