Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pandas as pd
- from random import choice, seed
- from string import ascii_uppercase
- seed(42)
- strings = [''.join(choice(ascii_uppercase) for i in range(32)) for j in range(10000)]
- # To create a pandas series from a list of strings
- strings_pandas = pd.Series(strings)
- # You query a pandas series like this
- strings_pandas[strings_pandas.str.contains('AAA')]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement