Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" Small script that shows hot to do one hot encoding | |
of categorical columns in a pandas DataFrame. | |
See: | |
http://scikit-learn.org/dev/modules/generated/sklearn.preprocessing.OneHotEncoder.html#sklearn.preprocessing.OneHotEncoder | |
http://scikit-learn.org/dev/modules/generated/sklearn.feature_extraction.DictVectorizer.html | |
""" | |
import pandas | |
import random |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/****** Script for SelectTopNRows command from SSMS ******/ | |
SELECT count(*) as [# Bookings], | |
ROUND((cast(Count([Flight Booking ID])* 100 as FLOAT) / (Select Count(*) From [Antrak].[dbo].[FlightBookingsMain] where isCancelled <> 'false')), 2) as [% Booking], | |
datename(dw, [Booking Date]) as [Most Popular Day] | |
FROM [Antrak].[dbo].[FlightBookingsMain] | |
where isCancelled <> 'false' | |
group by datename(dw, [Booking Date]) | |
order by [# Bookings] desc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Created on Wed Sep 28 22:17:41 2016 | |
@author: adaba | |
""" | |
import datetime | |
from calendar import monthrange | |
from dateutil.parser import parse |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*(a) rows in the trsnact table that have “0” in their orgprice column (how could the | |
--original price be 0?), */ | |
SELECT * | |
FROM TRNSACT | |
WHERE ORGPRICE = 0; | |
-- (b) rows in the skstinfo table where both the cost and retail price are listed as 0.00, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--Ex4 | |
SELECT * | |
FROM TRNSACT | |
WHERE AMT <> SPRICE; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT * | |
FROM deptinfo | |
SAMPLE 10 | |
ORDER BY dept ASC; | |
SELECT TOP 50 * | |
FROM skstinfo; | |
SELECT TOP 10* | |
FROM skstinfo_fix; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HELP TABLE deptinfo; | |
SHOW TABLE deptinfo; | |
HELP TABLE skstinfo; | |
SHOW TABLE skstinfo; | |
HELP TABLE skstinfo_fix; | |
SHOW TABLE skstinfo_fix; | |
HELP TABLE skuinfo; |
NewerOlder