Answers for "r remove all string before : and keep : in r data frame"

6

how to get just the filename in python

import os
>>> base=os.path.basename('/root/dir/sub/file.ext')
>>> base
'file.ext'
>>> os.path.splitext(base)
('file', '.ext')
>>> os.path.splitext(base)[0]
'file'
Posted by: Guest on May-19-2020
1

how to find rows with missing data in pandas

null_data = df[df.isnull().any(axis=1)]
Posted by: Guest on May-01-2020
0

r remove all string before : in r data frame

> x <- 'aabb.ccdd'
> sub('.*', '', x)
[1] ""
> sub('bb.*', '', x)
[1] "aa"
> sub('.*bb', '', x)
[1] ".ccdd"
> sub('\..*', '', x)
[1] "aabb"
> sub('.*\.', '', x)
[1] "ccdd"
Posted by: Guest on May-30-2020
0

how to print 2 list in python as table

a = ['a', 'b', 'c']
b = ['1', '0', '0']
res = "n".join("{} {}".format(x, y) for x, y in zip(a, b))
Posted by: Guest on May-20-2020

Code answers related to "r remove all string before : and keep : in r data frame"

Python Answers by Framework

Browse Popular Code Answers by Language