Hi, I am attempting GP 1. I tried to explore the data of the App Store and the output does not look correct to me. Can someone review my code?
Thanks
My Code:
# App Store data set #
opened_file = ('AppleStore.csv')
from csv import reader
read_file = reader(opened_file)
ios = list(read_file)
ios_header = ios[0]
ios = ios[1:]
# Google Play data set #
opened_file = ('googleplaystore.csv')
from csv import reader
read_file = reader(opened_file)
android = list(read_file)
android_header = android[0]
android = android[1:]
def explore_data(dataset, start, end, rows_and_columns=False):
dataset_slice = dataset[start:end]
for row in dataset_slice:
print(row)
print('\n')
if rows_and_columns:
print('Number of rows:', len(dataset))
print('Number of columns:', len(dataset[0]))
print(ios_header)
print('\n')
explore_data(ios, 0, 3, True)
What I expected to happen: To see the ios header row, followed by an empty line, then see data that corresponds to the first three rows of data of the App Store data set.
What actually happened:
['A']
['p']
['p']
['l']
Number of rows: 13
Number of columns: 1