Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. import pandas as pd
  2.  
  3. from random import choice, seed
  4. from string import ascii_uppercase
  5. seed(42)
  6. strings = [''.join(choice(ascii_uppercase) for i in range(32)) for j in range(10000)]
  7.  
  8. # To create a pandas series from a list of strings
  9. strings_pandas = pd.Series(strings)
  10.  
  11. # You query a pandas series like this
  12. strings_pandas[strings_pandas.str.contains('AAA')]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement