该阶段所有题目均来源于和鲸社区,链接:https://www.kesci.com/mw/project/5ef96ce863975d002c95fd8a/content
1.使用字典创建DataFrame
import pandas as pd
import numpy as np
data = {
'grammer':['Python','C','Java','GO','NaN','SQL','PHP','Python'],'score':[1.0,2.0,np.nan,4.0,5.0,6.0,7.0,10.0]}
df = pd.DataFrame(data)
df
2.提取含有字符串"Python"的行
df[df['grammer'] == 'Python']
result = df['grammer'].str.contains('Python')
result.fillna(value=False,inplace=True)
df[result]
DataFrame.fillna(value=,inplace=)
<