Skip to content

Instantly share code, notes, and snippets.

View decisionstats's full-sized avatar

Ajay Ohri decisionstats

  • Decisionstats.com
  • Internet
View GitHub Profile
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# An Tutorial for Data Science in Python\n",
"\n",
"Python is an amazing language and here we show a comprehensive tutorial in it for usage in Data Science.\n",
"\n",
{
"cells": [
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>web scraping-yelp.ca</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
names2<-c("Ajay","Vijay","Rajesh","Arinjay","Ram")
gsub("jay","Ohjay",names2)
names3=toupper(names2)
names3
grepl("jay",names3)
library(stringr)
names4=str_to_upper(names2)
names4
money=c("$50000","50,000",50000)
money2=gsub(",","",money)
@decisionstats
decisionstats / gist:a78d942d9c9a6271bbb9
Created July 26, 2015 07:58
import url data into pandas
{
"cells": [
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
@decisionstats
decisionstats / gist:ec34c1590f87e4ac6650
Created June 26, 2015 08:09
my new python notebook
{"nbformat_minor": 0, "cells": [{"execution_count": 1, "cell_type": "code", "source": "import pandas as pd", "outputs": [], "metadata": {"collapsed": true, "trusted": true}}, {"execution_count": 2, "cell_type": "code", "source": "import os as os", "outputs": [], "metadata": {"collapsed": true, "trusted": true}}, {"execution_count": 3, "cell_type": "code", "source": "a=os.getcwd()", "outputs": [], "metadata": {"collapsed": false, "trusted": true}}, {"execution_count": 4, "cell_type": "code", "source": "os.listdir(a)", "outputs": [{"execution_count": 4, "output_type": "execute_result", "data": {"text/plain": "['.continuum',\n '.enstaller4rc',\n '.idlerc',\n '.ipynb_checkpoints',\n '.ipython',\n '.matplotlib',\n '.RData',\n '.spyder2',\n 'AppData',\n 'Application Data',\n 'Canopy',\n 'Contacts',\n 'Cookies',\n 'Desktop',\n 'Documents',\n 'Downloads',\n 'Favorites',\n 'intermediate python notebook.ipynb',\n 'Links',\n 'Local Settings',\n 'Music',\n 'My Documents',\n 'my first R script file.R',\n 'My_First_Python_
{"nbformat_minor": 0, "cells": [{"execution_count": 77, "cell_type": "code", "source": "height = 150\n", "outputs": [], "metadata": {"collapsed": true, "trusted": true}}, {"execution_count": 78, "cell_type": "code", "source": "height", "outputs": [{"execution_count": 78, "output_type": "execute_result", "data": {"text/plain": "150"}, "metadata": {}}], "metadata": {"collapsed": false, "trusted": true}}, {"execution_count": 79, "cell_type": "code", "source": "print(height)", "outputs": [{"output_type": "stream", "name": "stdout", "text": "150\n"}], "metadata": {"collapsed": false, "trusted": true}}, {"execution_count": 80, "cell_type": "code", "source": "height%3\n", "outputs": [{"execution_count": 80, "output_type": "execute_result", "data": {"text/plain": "0"}, "metadata": {}}], "metadata": {"collapsed": false, "trusted": true}}, {"execution_count": 81, "cell_type": "code", "source": "test=56\ntest%4", "outputs": [{"execution_count": 81, "output_type": "execute_result", "data": {"text/plain": "0"}, "metadata"
{"nbformat_minor": 0, "cells": [{"execution_count": 2, "cell_type": "code", "source": "import pandas as pd", "outputs": [], "metadata": {"collapsed": true, "trusted": true}}, {"execution_count": 3, "cell_type": "code", "source": "import os as os", "outputs": [], "metadata": {"collapsed": true, "trusted": true}}, {"execution_count": 7, "cell_type": "code", "source": "a=os.getcwd()", "outputs": [], "metadata": {"collapsed": false, "trusted": true}}, {"execution_count": 8, "cell_type": "code", "source": "os.listdir(a)", "outputs": [{"execution_count": 8, "output_type": "execute_result", "data": {"text/plain": "['.continuum',\n '.enstaller4rc',\n '.idlerc',\n '.ipynb_checkpoints',\n '.ipython',\n '.matplotlib',\n '.RData',\n '.spyder2',\n 'AppData',\n 'Application Data',\n 'Canopy',\n 'Contacts',\n 'Cookies',\n 'Desktop',\n 'Documents',\n 'Downloads',\n 'Favorites',\n 'intermediate python notebook.ipynb',\n 'Links',\n 'Local Settings',\n 'Music',\n 'My Documents',\n 'my first R script file.R',\n 'My_First_Python_
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [