Skip to content

Instantly share code, notes, and snippets.

View suemnjeri's full-sized avatar

Susan N Maina suemnjeri

View GitHub Profile
data_json = pd.DataFrame(data_json, columns=['District', 'Grade', 'Year', 'Demographic', 'Number Tested',
'Mean Scale Score', 'Num Level 1', 'Pct Level 1', 'Num Level 2',
'Pct Level 2', 'Num Level 3', 'Pct Level 3', 'Num Level 4',
'Pct Level 4', 'Num Level 3 and 4', 'Pct Level 3 and 4'])
data = []
for i in range(0, len(district)):
record = [
district[i].get_text(),
grade[i].get_text(),
number_tested[i].get_text(),
mean_scale_score[i].get_text()
]
data.append(record)
district = soup.find_all('district')
grade = soup.find_all('grade')
number_tested = soup.find_all('number_tested')
mean_scale_score = soup.find_all('mean_scale_score')
f = open('math results.xml')
n = 20
for i in range(n):
print(f.readline())
f.close()
a_file = open("data/2006_-_2012__Math_Test_Results_-_District_-_All_Students.csv")
n = 5
for i in range(n):
line = a_file.readline()
print(line)
a_file.close()
len(os.listdir('/tmp/train/'))
#Results
#25000
zip_ref = zipfile.ZipFile('train.zip', 'r') #Opens the zip file in read mode
zip_ref.extractall('/tmp') #Extracts the files into the /tmp folder
zip_ref.close()
!kaggle competitions download -c dogs-vs-cats
import zipfile
import os
os.environ['KAGGLE_CONFIG_DIR'] = "/content"
!cp '/content/drive/MyDrive/Kaggle/kaggle.json' '/content'