Skip to content
Snippets Groups Projects
Commit 7bfd4af7 authored by Arturo Sanchez's avatar Arturo Sanchez
Browse files

primer analisis datos

parent 529bebca
No related branches found
No related tags found
No related merge requests found
.ipynb_checkpoints/
%% Cell type:code id: tags:
``` python
import pandas as pd
import csv
import numpy as np
import matplotlib as plt
import seaborn as sns
```
%% Cell type:code id: tags:
``` python
df_species = pd.read_csv("~/ejercicios-clase-08-datos/data-used/species.csv")
df_surveys = pd.read_csv("~/ejercicios-clase-08-datos/data-used/surveys.csv")
```
%% Cell type:code id: tags:
``` python
pip install --upgrade pip
```
%% Cell type:code id: tags:
``` python
df_species.head()
```
%% Cell type:code id: tags:
``` python
df_surveys.head()
```
%% Cell type:code id: tags:
``` python
df_surveys
```
%% Cell type:code id: tags:
``` python
df_species['species_id'].unique()
```
%% Cell type:code id: tags:
``` python
df_surveys['species_id'].unique()
```
%% Cell type:code id: tags:
``` python
df_surveysspecie= pd.merge(df_surveys,df_species,how='left',on=['species_id'])
```
%% Cell type:code id: tags:
``` python
df_surveysspecie
```
%% Cell type:code id: tags:
``` python
df_group_specie_id = df_surveysspecie.groupby('taxa').unique()
df_group_specie_id
```
%% Cell type:code id: tags:
``` python
plt.pyplot.scatter(df_surveysspecie[df_surveysspecie['weight']>0],df_surveysspecie[df_surveysspecie['hindfoot_length']>0]['weight'])
```
%% Cell type:code id: tags:
``` python
plt.pyplot.scatter(df_surveysspecie[df_surveysspecie['taxa']=='Rodent'][df_surveysspecie['hindfoot_length']>0]['year'],df_surveysspecie[df_surveysspecie['taxa']=='Rodent'][df_surveysspecie['hindfoot_length']>0]['hindfoot_length'])
```
%% Cell type:code id: tags:
``` python
df_surveysspecie[df_surveysspecie['taxa']=='Rodent']['weight']
```
%% Cell type:code id: tags:
``` python
df_surveysspecie.info()
```
%% Cell type:code id: tags:
``` python
df_surveysspecie['hindfoot_length']=df_surveysspecie['hindfoot_length'].fillna(0)
```
%% Cell type:code id: tags:
``` python
df_surveysspecie['weight']=df_surveysspecie['weight'].fillna(0)
```
%% Cell type:code id: tags:
``` python
plt.pyplot.scatter(df_surveysspecie['taxa'](skipna=True),df_surveysspecie['weight'])
```
%% Cell type:code id: tags:
``` python
df_surveysspecie['taxa'].hist()
```
%% Cell type:code id: tags:
``` python
df_surveysspecie['taxa'].unique()
```
%% Cell type:code id: tags:
``` python
df_surveysspecie[df_surveysspecie['weight']>0]['weight'].max()
```
%% Cell type:code id: tags:
``` python
df_weight_vs_taxa= pd.concat([df_surveysspecie[df_surveysspecie['weight']>0]['weight'],df_surveysspecie[df_surveysspecie['weight']>0]['taxa']],axis=1)
f,ax=plt.subplots()
fig
```
...@@ -30,4 +30,4 @@ tur08,Francia,9,15.5 ...@@ -30,4 +30,4 @@ tur08,Francia,9,15.5
tur09,Francia,10,17 tur09,Francia,10,17
tur10,Francia,5,11.5 tur10,Francia,5,11.5
tur11,Francia,20,26 tur11,Francia,20,26
tur12,Francia,27,43.5 tur12,Francia,27,43.5
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment