<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Monuments_all
Step1:  monuments_all_se-bbr_(sv)
Step2:  Let's check If we have extracted the two always occuring fields 'name' and 'buildId' for all objects
Step3:  How many objects did we get the other fields 'name2' and 'name3' for?
<ASSISTANT_TASK:>
Python Code:
cursor.execute("SELECT * FROM monuments_all WHERE country='se-bbr'")
all_bbr = pd.io.sql.read_sql('select * from monuments_all WHERE country="se-bbr"', conn)
all_bbr.shape
Explanation: Monuments_all
End of explanation
table_name = "se_bbr" # I've renamed monuments_se-bbr_(se) to 'se_bbr' in local database, change to correct name
se_bbr = pd.io.sql.read_sql('select * from se_bbr', conn)
se_bbr.shape
se_bbr.keys()
se_bbr.ix[10:20, ["namn","funktion"]]
first = se_bbr.groupby("kommun")[["funktion","namn"]].first()
first.head()
first.loc[["Ale","Täby","Åre"],["funktion","namn"]]
se_bbr.namn.str.extract('(?P<name>\[\[[\w\.\|\- ]+\]\])\,? ?(?P<name2>[ \w]+)? ?(?P<name3>\[\[[\w\.\|\- ]+\]\])? ?(?P<buildId>\([\w\.\d \|\:\-;,]+\))',expand=True)
se_bbr.ix[5672]
Explanation: monuments_all_se-bbr_(sv)
End of explanation
se_bbr_namn = se_bbr.namn.str.extract('(?P<name>\[\[[\w`\.,\|\- ]+\]\])\,? ?(?P<name2>[ \w]+)? ?(?P<name3>\[\[[\w\.\|\- ]+\]\])? ?(?P<buildId>\([\w\.\d \|\:\-;,]+\))',expand=True)
len(se_bbr_namn[se_bbr_namn["name"] == pd.np.nan])
len(se_bbr_namn[se_bbr_namn["buildId"] != pd.np.nan])
se_bbr[pd.isnull(se_bbr["namn"])]
len(se_bbr_namn.name.value_counts())
len(se_bbr_namn.name2.value_counts())
len(se_bbr_namn.name3.value_counts())
Explanation: Let's check If we have extracted the two always occuring fields 'name' and 'buildId' for all objects
End of explanation
se_bbr_namn.name3.value_counts()
se_bbr[se_bbr.namn.str.contains("sproge", flags=re.IGNORECASE) == True]
Explanation: How many objects did we get the other fields 'name2' and 'name3' for?
End of explanation
<END_TASK>