# Day 20: Exploring Python for Data Analysis – The Numpy Library – Part 2

Checking out Python Numpy Tutorial by Justin Johnson. Quick Review of Python Data Types: Booleans t = True f = False print(type(t)) # Prints “<class ‘bool’>” print(t and f) # Logical AND; prints “False” Strings s = “hello” print(s.capitalize()) # Capitalize a string; prints “Hello” print(s.upper()) # Convert a string to uppercase; prints “HELLO” print(s.rjust(7)) # Right-justify a string, padding with spaces; prints ” hello” … Continue reading Day 20: Exploring Python for Data Analysis – The Numpy Library – Part 2

# Day 19: Exploring Python for Data Analysis – The Numpy Library

From “Quickstart tutorial”: NumPy’s main object is the homogeneous multidimensional array. It is a table of elements (usually numbers), all of the same type, indexed by a tuple of positive integers. In NumPy dimensions are called axes. NumPy’s array class is called ndarray – some important attributes listed: ndarray.ndim (the number of axes (dimensions) of the array.) ndarray.shape (the dimensions of the array – a … Continue reading Day 19: Exploring Python for Data Analysis – The Numpy Library

# Day 18: Exploring Python for Data Analysis

As advice from “Step by step approach to perform data analysis using Python”: First, start learning NumPy as it is the fundamental package for scientific computing with Python. A good understanding of Numpy will help you use tools like Pandas effectively. Next let us check out “A Complete Python Tutorial to Learn Data Science from Scratch”. It is provided a long list of libraries for … Continue reading Day 18: Exploring Python for Data Analysis

# Day 17: Explore Machine Learning with Python-2

Today I am checking out “How to get started with Machine Learning in about 10 minutes”. Few excerpts: IMPORT import numpy as np import pandas as pdimport matplotlib.pyplot as pltimport seaborn as snsimport warningswarnings.filterwarnings(‘ignore’)%matplotlib inline LOAD train_df=pd.read_csv(“train.csv”)train_df.head() CHECK MISSING def missingdata(data): total = data.isnull().sum().sort_values(ascending = False) percent = (data.isnull().sum()/data.isnull().count()*100).sort_values(ascending = False) ms=pd.concat([total, percent], axis=1, keys=[‘Total’, ‘Percent’]) ms= ms[ms[“Percent”] > 0] f,ax =plt.subplots(figsize=(8,6)) plt.xticks(rotation=’90’) fig=sns.barplot(ms.index, ms[“Percent”],color=”green”,alpha=0.8) … Continue reading Day 17: Explore Machine Learning with Python-2

# Day 16: Exploring Machine Learning with Python

SciPy is a Python library for scientific / technical computing. Some of its core packages: 1) NumPy: Base N-dimensional array package 2) SciPy: Fundamental library for scientific computing 3) Matplotlib: Comprehensive 2D Plotting 4) IPython: Enhanced Interactive Console 5) Sympy: Symbolic mathematics 6) pandas: Data structures & analysis Let us directly jump in and look at some of the steps listed at Your First Machine … Continue reading Day 16: Exploring Machine Learning with Python

# Day 15: Python – Notes on Webscraping

A summary from the enticing post “How to Web Scrape with Python in 4 Minutes”: LIBRARIES: import requests import urllib.request import time from bs4 import BeautifulSoup Accessing the target URL: url = ‘http://web.mta.info/developers/turnstile.html’ response = requests.get(url) Nest the data using BeautifulSoup data structure (See the BeatifulSoup documentation). soup = BeautifulSoup(response.text, “html.parser”) Search for links: soup.findAll(‘a’) Extract the link: one_a_tag = soup.findAll(‘a’)[36] link = one_a_tag[‘href’] Another … Continue reading Day 15: Python – Notes on Webscraping

# Day 14 Exploring Python – Flask vs Django

Django is good for faster building of full web applications (because lot of stuff is pre-packaged). But, then, that makes it heavier and you may have less control and you may have lot of unnecessary packaged code shipped. Considering speed as a factor, from a business (though maybe short-term) perspective, Django could be seen as attractive. Twilio tech team shares how they a using Flask on … Continue reading Day 14 Exploring Python – Flask vs Django

# Day 13: Exploring Python – Creating Games

We start Day 13 with a new resource – a book available for reading online – Invent Your Own Computer Games with Python (4th Edition) by Al Sweigart. 1. Introduction – after installation – Start IDLE (Interactive DeveLopment Environment), on Windows, click the Start menu in the lower-left corner of the screen, type IDLE, and select IDLE (Python GUI). 2. Chapter 2: Hello World print(‘Hello … Continue reading Day 13: Exploring Python – Creating Games

# Day 12: Exploring Python with Django – Under The Hood

On Day 11, we identified “Django tips and tricks: Part 1″ as of the interesting resources – here are few insights from the article: Django is a full stack framework, while Flask is a micro service framework. This means that Flask has no database abstraction layer, form validation or templating. Flask gives you more fine grained control of each aspect of your application while Django gives … Continue reading Day 12: Exploring Python with Django – Under The Hood

# Day 11: Exploring Python with Django – Tips

Time to list and look at a few resources describing tips and tricks in Django. 10 Tips for Beginners to Learn Django 10 Insanely Useful Django Tips 22 Tips 9 Django Tips for Working with Databases Django tips and tricks: Part 1 More than enough work for Day 11! Continue reading Day 11: Exploring Python with Django – Tips