Skip to content

Instantly share code, notes, and snippets.

@adilek
Created June 6, 2018 14:50
Show Gist options
  • Save adilek/8a4f8767a9f32ca75e067f2bc8a1f3f8 to your computer and use it in GitHub Desktop.
Save adilek/8a4f8767a9f32ca75e067f2bc8a1f3f8 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 14,
"metadata": {
"scrolled": true
},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>id</th>\n",
" <th>username</th>\n",
" <th>first_name</th>\n",
" <th>last_name</th>\n",
" <th>birth_year</th>\n",
" <th>points</th>\n",
" <th>email</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>39</th>\n",
" <td>40</td>\n",
" <td>christopher.parker</td>\n",
" <td>Christopher</td>\n",
" <td>Parker</td>\n",
" <td>1982</td>\n",
" <td>4</td>\n",
" <td>christopher.parker@example.com</td>\n",
" </tr>\n",
" <tr>\n",
" <th>49</th>\n",
" <td>50</td>\n",
" <td>christian.sawyer</td>\n",
" <td>Christian</td>\n",
" <td>Sawyer</td>\n",
" <td>1993</td>\n",
" <td>12</td>\n",
" <td>christian.sawyer@example.com</td>\n",
" </tr>\n",
" <tr>\n",
" <th>54</th>\n",
" <td>55</td>\n",
" <td>charles.ryder</td>\n",
" <td>Charles</td>\n",
" <td>Ryder</td>\n",
" <td>1984</td>\n",
" <td>15</td>\n",
" <td>charles.ryder@example.com</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" id username first_name last_name birth_year points \\\n",
"39 40 christopher.parker Christopher Parker 1982 4 \n",
"49 50 christian.sawyer Christian Sawyer 1993 12 \n",
"54 55 charles.ryder Charles Ryder 1984 15 \n",
"\n",
" email \n",
"39 christopher.parker@example.com \n",
"49 christian.sawyer@example.com \n",
"54 charles.ryder@example.com "
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"users[users[\"first_name\"].str.startswith('Ch')]"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.5"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment