Question: I am learning Machine Learning and trying to write a code from myself using the Iris Dataset.

I open the dataset with pandas and then I am trying to pass a dictionary in my dataset to convert the last column from Strings into Int but when try this:

```
dataset.columns = ['sepal length', 'sepal width', 'petal length', 'petal width', 'class']

class_mapping = {'Iris-setosa': 1, 'Iris-versicolor': 2, 'Iris-virginica': 3}
for classe in dataset :
    classe['class'] = classe['class'].map(class_mapping)

```

PyCharm returns me this: TypeError: string indices must be integers

Answer: 
one mistake is there,
You already have arraylist in your activity so try this,

```
mList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
                public void onItemClick(AdapterView<?> parent, View view, int position,
                                        long id) {
                                    String value =  array_list.get(position).getpenyakit_nama();

                    Toast.makeText(getBaseContext(), value, Toast.LENGTH_LONG).show();

                }
            });

```

Do let me know if this works or not
```
String value = mList.getItemAtPosition(position).toString();

```

it will be get `Penyakit` object.
if you want get `penyakit_nama` value, use below code.

```
String value = ((Penyakit)mList.getItemAtPosition(position)).getpenyakit_nama();

```

because generic type of your ArrayAdapter is `<Penyakit>`, `getItemAtPosition()` will return `Penyakit` object