How can I get to String "no comm" instead of null value using pandas in python ?
Question: How can I get to string "no comm" instead of null value using pandas ?

emp.csv

    
    
    index   empno   ename   job mgr hiredate    sal comm    deptno
    0,  7839,   KING,   PRESIDENT,  0,  1981-11-17,     5000,    ,  10
    1,  7698,   BLAKE,  MANAGER,    7839,   1981-05-01, 2850,    ,  30
    2,  7782,   CLARK,  MANAGER,    7839,   1981-05-09, 2450,    ,  10
    3,  7566,   JONES,  MANAGER,    7839,   1981-04-01, 2975,    ,  20
    4,  7654,   MARTIN, SALESMAN,   7698,   1981-09-10, 1250,   1400,   30
    5,  7499,   ALLEN,  SALESMAN,   7698,   1981-02-11, 1600,    300,    30
    6,  7844,   TURNER, SALESMAN,   7698,   1981-08-21, 1500,   0,  30
    7,  7900,   JAMES,  CLERK,      7698,   1981-12-11, 950,     ,  30
    8,  7521,   WARD,   SALESMAN,   7698,   1981-02-23, 1250,   500,    30
    9,  7902,   FORD,   ANALYST,    7566,   1981-12-11, 3000,    ,  20
    10, 7369,   SMITH,  CLERK,      7902,   1980-12-09, 800,     ,  20
    11, 7788,   SCOTT,  ANALYST,    7566,    1982-12-22, 3000,   ,  20
    12, 7876,   ADAMS,  CLERK,      7788,   1983-01-15, 1100,    ,  20
    13, 7934,   MILLER, CLERK,      7782,   1982-01-11, 1300,    ,  10
    

I want to get the below result about column comm using pandas.

result :

    
    
    no comm
    no comm
    no comm
    no comm
    1400
    300
    0
    no comm
    500
    no comm
    no comm
    no comm
    no comm
    no comm
    

I want to get above result using bleow code.

code :

    
    
    import sys
    
    import pandas as pd
    import dateutil
    
    
    
    import pandas as pd
    import io
    
    temp=u"""index   empno   ename   job mgr hiredate    sal comm    deptno
    0,  7839,   KING,   PRESIDENT,  0,  1981-11-17,     5000,    ,  10
    1,  7698,   BLAKE,  MANAGER,    7839,   1981-05-01, 2850,    ,  30
    2,  7782,   CLARK,  MANAGER,    7839,   1981-05-09, 2450,    ,  10
    3,  7566,   JONES,  MANAGER,    7839,   1981-04-01, 2975,    ,  20
    4,  7654,   MARTIN, SALESMAN,   7698,   1981-09-10, 1250,   1400,   30
    5,  7499,   ALLEN,  SALESMAN,   7698,   1981-02-11, 1600,    300,    30
    6,  7844,   TURNER, SALESMAN,   7698,   1981-08-21, 1500,   0,  30
    7,  7900,   JAMES,  CLERK,      7698,   1981-12-11, 950,     ,  30
    8,  7521,   WARD,   SALESMAN,   7698,   1981-02-23, 1250,   500,    30
    9,  7902,   FORD,   ANALYST,    7566,   1981-12-11, 3000,    ,  20
    10, 7369,   SMITH,  CLERK,      7902,   1980-12-09, 800,     ,  20
    11, 7788,   SCOTT,  ANALYST,    7566,    1982-12-22, 3000,   ,  20
    12, 7876,   ADAMS,  CLERK,      7788,   1983-01-15, 1100,    ,  20
    13, 7934,   MILLER, CLERK,      7782,   1982-01-11, 1300,    ,  10"""
    #after testing replace io.StringIO(temp) to filename
    emp = pd.read_csv(io.StringIO(temp), 
                     skipinitialspace=True,
                     skiprows=1, 
                     parse_dates=[5], 
                     names=['index','empno','ename', 'job','mgr','hiredate','sal','comm','deptno'])
    
    
                                                   <--------------  ?  
    
    
    print( emp['comm'])
    


Answer: this could just be the formatting on this site, but it looks like 1400, 300, 0
and 500 are in a different level of indentation to the rest of the numbers,
which is why it would return no comm

