Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- date path
- 2017-01-01 /A/B/C/D
- 2017-01-01 /X
- 2017-01-01 /X/Y
- date path
- 2017-01-01 /A/B
- 2017-01-01 /X
- 2017-01-01 /X/Y
- from urllib import quote_plus
- path_levels = df['path'].split('/')
- filtered_path_levels = []
- for _level in range(min(df_size, 3)):
- # Take only the top 2 levels of path
- filtered_path_levels.append(quote_plus(path_levels[_level]))
- df['path'] = '/'.join(map(str, filtered_path_levels))
- path_levels = split(results_df['path'], '/')
- filtered_path_levels = []
- for _level in range(size(df_size, 3)):
- # Take only the top 2 levels of path
- filtered_path_levels.append(quote_plus(path_levels[_level]))
- df['path'] = '/'.join(map(str, filtered_path_levels))
- ValueError: Cannot convert column into bool: please use '&' for 'and', '|' for 'or', '~' for 'not' when building DataFrame boolean expressions.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement