Skip to content

Instantly share code, notes, and snippets.

View Akash-Ansari's full-sized avatar

Akash Ansari Akash-Ansari

View GitHub Profile
###################################################### Loading and viewing your data ###########################################
# In this chapter, you're going to look at a subset of the Department of Buildings Job Application Filings dataset from the NYC Open
# Data portal. (https://opendata.cityofnewyork.us/) This dataset consists of job applications filed on January 22, 2017.
# Your first task is to load this dataset into a DataFrame and then inspect it using the .head() and .tail() methods. However, you'll
# find out very quickly that the printed results don't allow you to see everything you need, since there are too many columns.
########################################## Importing Data in Python (Part 2) #############################################
########################################## Importing flat files from the web: your turn! #################################
# You are about to import your first file from the web! The flat file you will import will be 'winequality-red.csv' from the University # of California, Irvine's Machine Learning repository. The flat file contains tabular data of physiochemical properties of red wine,
# such as pH, alcohol content and citric acid content, along with wine quality rating.
# The URL of the file is
# Reading a text file
# Steps:
filename = "Huck_finn.txt"
file = open(filename, mode = "r")
text = file.read()
print(text)
print(file.closed) # returns boolean value; indicates that the file is closed or not.
file.close() # closes the file
# Calculating Area for Rectangle and Circle
import math
def get_area(shape):
shape = shape.lower()
if shape == "rectangle":
rectangle_area()
# Printing prime numbers upto a certain number
def is_prime(num):
for i in range(2, num):
if (num % i) == 0:
return False
return True
Please Upload this file to the server.
http://extratorrent.cc/torrent/5291977/Udemy+-+Case+Studies+in+Data+Mining+with+R.html
@Akash-Ansari
Akash-Ansari / Agrojobs Scraping in R.R
Last active September 10, 2016 03:15
A Simple Code to Extract Agricultural Jobs Information from bdjobs.com
###################################### Scraping Bdjobs.com ##############################################
# For selecting css elements, I have used the Chrome Extension "SelectorGadget" along
# with the "rvest" (version: 0.3.2) and "xml2" packages.
# Machine Info :
# R version 3.2.3 (2015-12-10)
# Platform: x86_64-w64-mingw32/x64 (64-bit)
# Running under: Windows 7 x64 (build 7600)
# To check yours type version OR sessionInfo()