I have df
'date', 'ip', 'type_connection', 'user_agent', 'smth', 'type', 'weight', 'smth1', 'url'
1480394201  127.0.75.123:3000   CONNECT -   200 -   0   uic.login.skype.com:443 -   
1480394202  127.0.75.123:3000   CONNECT -   200 -   0   uic.login.skype.com:443 -   
1480394203  127.0.75.123:3000   CONNECT -   200 -   0   uic.login.skype.com:443 -   -
1480395766  127.0.0.1   127.255.255.254:3000    CONNECT curl/7.38.0 200 -   0   google.com:443  -
1480395766  127.0.0.1   127.255.255.254:3000    HEAD    curl/7.38.0 403 text/html   220 https://google.com/ -
I need to delete strings from column type_connection and shift this part of table to the left
Desire output
'date', 'ip', 'type_connection', 'user_agent', 'smth', 'type', 'weight', 'smth1', 'url'
1480394201  127.0.75.123:3000   CONNECT -   200 -   0   uic.login.skype.com:443 -   
1480394202  127.0.75.123:3000   CONNECT -   200 -   0   uic.login.skype.com:443 -   
1480394203  127.0.75.123:3000   CONNECT -   200 -   0   uic.login.skype.com:443 -   -
1480395766  127.0.0.1   CONNECT curl/7.38.0 200 -   0   google.com:443  -
1480395766  127.0.0.1   HEAD    curl/7.38.0 403 text/html   220 https://google.com/ -
I use
df.type_connection = np.where(df.type_connection.str.contains(':'), df.user_agent, df.type_connection)
but it shift only one column user_agent
 
    