Skip to content

Instantly share code, notes, and snippets.

@aln787
Created April 14, 2019 18:30
Show Gist options
  • Save aln787/356a6b3e9e2cb9c439d40a6ecfc5e7dc to your computer and use it in GitHub Desktop.
Save aln787/356a6b3e9e2cb9c439d40a6ecfc5e7dc to your computer and use it in GitHub Desktop.
#https://hub.mybinder.org/lab/user/jupyterlab-jupyterlab-demo-whkn85a9
import pandas as pd
from io import StringIO
cabin_data = StringIO("""CABIN NAME,WHERE LOCATED,CABIN TYPE,PETS ALLOWED,MAXIMUM CAPACITY,PATC MAP,# MILES FROM D.C.,HIKE-IN DISTANCE,DISTANCE TO THE AT,PER NIGHT RATE THU/FRI/SAT,PER NIGHT RATE SUN - WED,PER NIGHT RATE ADVANCED RENTAL,PATC Membership Required,Available
Anna Michener,Pennsylvania,Primitive,yes,14,2-3,105,1 mile,0.3 mile,$50.00,$35.00,$100/$70,no,no
Argow Cabin,Virginia,Primitive,yes,8,11,120,1 mile,1 mile,$55.00,$40.00,$110/$80,yes,no
Bear Spring,Maryland,Primitive,yes,6,5-6,59,0.4 mile,0.8 mile,$50.00,$35.00,$100/$70,no,yes
Bears Den Cottage,Virginia,Semi-Primitive,yes,8,8,56,0.3 mile,300 feet,$75.00,$50.00,$150/$100,no,yes
Blackburn Tr. Ctr.,Virginia,Semi-Primitive,no,22,7,50,none,0.2 mile,$140.00*,$80.00*,$280/$160*,yes,yes
Catoctin Hollow Lodge,Maryland,Modern,no,8,5-6,65,0.7 miles,N/A,$140.00,$80.00,$280/$160,no,yes
Cliff's House,Virginia,Modern,yes,6,10,110,none,N/A,$90.00,$50.00,$180/$100,yes,yes
Conley,Virginia,Primitive,yes,8,11,105,0.4 mile,N/A,$50.00,$35.00,$100/$70,yes,no
Corbin,SNP,Primitive,yes,12,10,93,1.4 miles,1.5 miles,$45.00,$30.00,$90/$60,no,yes
Dawson,Pennsylvania,Primitive,yes,7,--,119,0.2 mile,N/A,$35.00,$25.00,$70/$50,no,yes
Doyles River,SNP,Primitive,yes,12,11,129,0.4 mile,0.3 mile,$45.00,$30.00,$90/$60,no,no
Dunlodge,Virginia,Modern,no,8,--,115,none,N/A,$175.00,$90.00,$350/$180,yes,no
Glass House,Virginia,Modern,yes,8,G,85,none,N/A,$100.00,$60.00,$200/$120,yes,no
Gypsy Spring,Pennsylvania,Modern,yes,6,2-3,106,none,1.2 miles,$90.00,$50.00,$180/$100,yes,yes
Hermitage,Pennsylvania,Primitive,yes,8,4,82,0.2 mile,0.7 mile,$50.00,$35.00,$100/$70,no,no
Highacre,West Va.,Modern,no,8,7,65,none,30 feet,$155.00,$90.00,$310/$180,yes,no
Horwitz,Virginia,Modern,no,6,9,72,none,N/A,$110.00,$70.00,$220/$140,yes,yes
Huntley,Virginia,Modern,no,6,10,91,none,2.9 miles,$135.00,$80.00,$270/$160,yes,no
John's Rest,Virginia,Primitive,yes,6,10,100,0.3 mile,4 miles,$50.00,$35.00,$100/$70,yes,yes
Johnson,Virginia,Primitive,yes,4,11,105,0.8 mile,N/A,$35.00,$25.00,$70/$50,no,yes
Jones Mountain,SNP,Primitive,yes,10,10,109,3.8 miles,5.9 miles,$45.00,$30.00,$90/$60,no,no
Lambert,Virginia,Modern,yes,8,10,91,0.1 mile,2.9 miles,$80.00,$50.00,$160/$100,yes,yes
Little Cove,Pennsylvania,Modern,yes,8,K,102,none,N/A,$110.00,$70.00,$220/$140,yes,no
Little Orleans,Maryland,Semi-Primitive,yes,8,--,116,none,N/A,$80.00,$50.00,$160/$100,yes,yes
Meadows,Virginia,Semi-Primitive,yes,12,10,100,0.2 mile,6 miles,$80.00,$50.00,$160/$100,yes,yes
Milesburn,Pennsylvania,Primitive,yes,10,2-3,101,40 feet,60 feet,$50.00,$35.00,$100/$70,no,no
Morris Virginia,Primitive,yes,12,11,105,0.5 mile,N/A,$50.00,$35.00,$100/$70,yes,no
Mutton Top,Virginia,Primitive,yes,9,11,105,0.5 mile,N/A,$60.00,$40.00,$120/$80,yes,no
Myron Glaser,Virginia,Primitive,yes,12,8,56,1.9 mile,0.2 mile,$50.00,$35.00,$100/$70,yes,yes
Old Rag,Virginia,Modern,no,8,10,87,none,6 miles,$100.00,$60.00,$200/$120,yes,no
Olive Green,Maryland,Primitive,no,4,5-6,65,none,N/A,$35.00,$25.00,$70/$50,no,yes
Pocosin,SNP,Primitive,yes,8,10,114,0.2 mile,0.1 mile,$45.00,$30.00,$90/$60,no,yes
Range View,SNP,Primitive,yes,8,9,93,0.8 mile,0.1 mile,$45.00,$30.00,$90/$60,no,no
Robert Humphrey,Virginia,Semi-Primitive,yes,8,10,125,none,N/A,$75.00,$45.00,$150/$90,yes,yes
Rock Spring,SNP,Primitive,yes,8,10,102,0.8 mile,0.2 mile,$45.00,$30.00,$90/$60,no,yes
Rosser Lamb,Virginia,Primitive,yes,12,10,101,1.0 mile,3 miles,$60.00,$40.00,$120/$80,yes,?
Schairer Tr. Ctr.,Virginia,Semi-Primitive,yes,12,11,120,0.4 mile,1 mile,$80.00,$50.00,$160/$100,yes,yes
Silberman Tr. Ctr.,Pennsylvania,Primitive,yes,8,K,108,none,N/A,$60.00,$40.00,$120/$80,yes,no
Sugar Knob,GWNF,Primitive,yes,4,F,105,3.2 miles,N/A,$35.00,$25.00,$70/$50,no,yes
Tulip Tree,Virginia,Primitive,yes,8,10,91,0.1 mile,2.6 miles,$50.00,$35.00,$100/$70,yes,yes
Vining,Virginia,Modern,yes,6,11,103,0.3 mile,N/A,$100.00,$60.00,$200/$120,yes,no
Wineberry,Virginia,Primitive,yes,8,11,105,0.4 mile,N/A,$50.00,$35.00,$100/$70,yes,no""")
df = pd.read_csv(cabin_data, sep=",")
df
dfa = df[df['Available'] == 'yes']
dfap = dfa.loc[(df['PETS ALLOWED'] == 'yes')].sort_values(by='PATC Membership Required')
dfa.iloc[2]
dfa.iloc[2][' PETS ALLOWED']
dfap = dfa.loc[(df['PETS ALLOWED'] == 'yes')].sort_values(by='PATC Membership Required')
dfap.loc[(df['HIKE-IN DISTANCE'] != 'none') & (df['CABIN TYPE'] != 'Modern') & (~df['CABIN NAME'].isin(['Dawson','Meadows','Tulip Tree']))]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment