I’ve been following the guided project and have run into some unexpected behaviour with my code.
I’ve assigned the Google Play Store data to a list, but when trying to recall an item in a row, only the first character is returned:
def explore_data(dataset, start, end, rows_and_columns=False): dataset_slice = dataset[start:end] for row in dataset_slice: print(row) print('\n') # adds a new (empty) line after each row if rows_and_columns: print('Number of rows:', len(dataset)) print('Number of columns:', len(dataset)) def open_file(file): opened_file = open(file) from csv import reader read_file = reader(opened_file) data_list = list(opened_file) file_data = data_list[1:] file_headers = data_list return file_headers, file_data google_headers,google_data = open_file('googleplaystore.csv') len(google_data) explore_data(google_data,0,10841) first_name = google_data print(first_name)
The output of
P, and the same happens any time I try to retrieve item  from a row. Trying to retrieve later items also brings back the nth character in the row, rather than the item.
Can anyone help me with what I’m doing wrong?