Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Jennifer Lorena Ortega Aguilar
Proyecto_Datos
Commits
9c22311e
Commit
9c22311e
authored
Apr 24, 2021
by
Jennifer Lorena Ortega Aguilar
Browse files
Inicio proyecto ciencia de datos
parent
fe769acb
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
.ipynb_checkpoints/Data Analysis with images from Mars-checkpoint.ipynb
View file @
9c22311e
{
"cells": [],
"metadata": {},
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Data Analysis with images from Mars\n",
"## Nombres: Gerardo Semprúm, Carla Gomez, Jennifer Ortega."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"from PIL import Image\n",
"from PIL.ExifTags import TAGS"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"imagename = \"Data/Mars.png\"\n",
"\n",
"# read the image data using PIL\n",
"image = Image.open(imagename)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"exifdata = image.getexif()"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"for tag_id in exifdata:\n",
" tag = TAGS.get(tag_id, tag_id)\n",
" data = exifdata.get(tag_id)\n",
" # decode bytes \n",
" if isinstance(data, bytes):\n",
" data = data.decode()\n",
" print(f\"{tag:25}: {data}\")\n",
" print('Hola')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"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.7.3"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
%% Cell type:markdown id: tags:
# Data Analysis with images from Mars
## Nombres: Gerardo Semprúm, Carla Gomez, Jennifer Ortega.
%% Cell type:code id: tags:
```
python
from
PIL
import
Image
from
PIL.ExifTags
import
TAGS
```
%% Cell type:code id: tags:
```
python
imagename
=
"Data/Mars.png"
# read the image data using PIL
image
=
Image
.
open
(
imagename
)
```
%% Cell type:code id: tags:
```
python
exifdata
=
image
.
getexif
()
```
%% Cell type:code id: tags:
```
python
for
tag_id
in
exifdata
:
tag
=
TAGS
.
get
(
tag_id
,
tag_id
)
data
=
exifdata
.
get
(
tag_id
)
# decode bytes
if
isinstance
(
data
,
bytes
):
data
=
data
.
decode
()
print
(
f
"
{
tag
:
25
}
:
{
data
}
"
)
print
(
'Hola'
)
```
%% Cell type:code id: tags:
```
python
```
...
...
Data Analysis with images from Mars.ipynb
View file @
9c22311e
This diff is collapsed.
Click to expand it.
Data/Mars.png
0 → 100644
View file @
9c22311e
3.12 MB
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment