My data
data = [{"content": "1", "title": "chestnut", "info": "", "time": 1578877014},
{"content": "2", "title": "chestnut", "info": "", "time": 1579877014},
{"content": "3", "title": "ches", "info": "", "time": 1582877014},
{"content": "aa", "title": "ap", "info": "", "time": 1582876014},
{"content": "15", "title": "apple", "info": "", "time": 1581877014},
{"content": "16", "title": "banana", "info": "", "time": 1561877014},
]
Mycode
index=[i['content'] for i in data]
s=pd.Series(data,index)
print((s[s.str.get('title').contains('ches',regex=True)]))
Error occured
AttributeError: 'Series' object has no attribute 'contains'
I want to achieve this effect, how do I use contains contais document: https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.str.contains.html#pandas.Series.str.contains.
I want the data to be
[
{"content": "1", "title": "chestnut", "info": "", "time": 1578877014},
{"content": "2", "title": "chestnut", "info": "", "time": 1579877014},
{"content": "3", "title": "ches", "info": "", "time": 1582877014},
]