Question: Here's the Code to pass and get image through intent,

secondActivity
--------------

```
                Intent intent = new Intent(this, PostVideoTagLocation.class);
                Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.index);
                ByteArrayOutputStream stream = new ByteArrayOutputStream();
                bmp.compress(Bitmap.CompressFormat.PNG, 100, stream);
                byte[] byteArray = stream.toByteArray();
                Intent intent2 = new Intent();
                intent2.putExtra("picture", byteArray);
                startActivityForResult(intent,1);
                setResult(RESULT_OK, intent2);

```

firstActivity
-------------

```
          if (requestCode == 1) {
            if(resultCode == RESULT_OK){
                Bundle extras = getIntent().getExtras();
                byte[] byteArray = extras.getByteArray("picture");
                Bitmap bmp = BitmapFactory.decodeByteArray(byteArray, 0, byteArray.length);
                ImageView image = (ImageView) findViewById(R.id.add_photo);
                image.setImageBitmap(bmp);
              }
           }

```

Answer: 
```
np.random.seed([3,1415])
s = pd.Series(np.random.choice(list('ABCDEFGHIJ'), 1000, p=np.arange(1, 11) / 55.))

s.value_counts()

I    176
J    167
H    136
F    128
G    111
E     85
D     83
C     52
B     38
A     24
dtype: int64

```

---

As percent

```
s.value_counts(normalize=True)

I    0.176
J    0.167
H    0.136
F    0.128
G    0.111
E    0.085
D    0.083
C    0.052
B    0.038
A    0.024
dtype: float64

```

---

```
counts = s.value_counts()
percent = counts / counts.sum()
fmt = '{:.1%}'.format
pd.DataFrame({'counts': counts, 'per': percent.map(fmt)})

   counts    per
I     176  17.6%
J     167  16.7%
H     136  13.6%
F     128  12.8%
G     111  11.1%
E      85   8.5%
D      83   8.3%
C      52   5.2%
B      38   3.8%
A      24   2.4%

```
Create two series, first one with absolute values and a second one with percentages, and concatenate them:

```
import pandas 

d = {'mark': ['pos', 'pos', 'pos', 'pos', 'pos', 
              'neg', 'neg', 'neg', 'neg', 
              'neutral', 'neutral' ]}
df = pd.DataFrame(d)

absolute = df['mark'].value_counts(normalize=False)
absolute.name = 'value'
percentage = df['mark'].value_counts(normalize=True)
percentage.name = '%'
percentage = (percentage*100).round(2)
pd.concat([absolute, percentage], axis=1)

```

Output:

```
       value    %
pos     5   45.45
neg     4   36.36
neutral 2   18.18

```