Question: How to split up a column and extract the gender and ages. From the screen shot, the df.head() is an example output of the data,

How to split up a column and extract the gender and ages. From the screen shot, the df.head() is an example output of the data, where the M stands for Male and the 0 in front of that is the count of the observation. How would you split this into multiple columns in python or juypter.
In [1]: import pandas as pd import numpy as np import matplotlib.pyplot as plt In [20]: df = pd.read_csv('/Users/17049/OneDrive/Desktop/Morphdata.csv', header = None) In [21]: df.head() Out[21]: 0 O Album2/009055_OM54.JPG 1 Album2/009055_1M54.JPG 2 Album2/019066_OM67.JPG 3 Album2/019066_1M68.JPG 4. Album2/019066_2M69.JPG
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
