-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPruebas 1
123 lines (123 loc) · 7.15 KB
/
Pruebas 1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "Pruebas",
"version": "0.3.2",
"provenance": [],
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/github/astrodatos/proyecto_ps2/blob/master/Pruebas%201\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "code",
"metadata": {
"id": "ZYGHpzVG_hep",
"colab_type": "code",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 513
},
"outputId": "a4d583ca-1927-48b3-be67-9683ba70bc75"
},
"source": [
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"import seaborn as sns\n",
"import sklearn as sk\n",
"import pandas as pd\n",
"!pip install astroquery\n",
"from astroquery.gaia import Gaia\n",
"data = Gaia.launch_job(\"\"\"SELECT TOP 2000 gaia_source.source_id,gaia_source.ra,gaia_source.ra_error,gaia_source.dec,gaia_source.dec_error,gaia_source.phot_g_mean_mag,gaia_source.bp_rp,gaia_source.g_rp,gaia_source.phot_variable_flag,gaia_source.teff_val,gaia_source.a_g_val,gaia_source.radius_val,gaia_source.lum_val\n",
"FROM gaiadr2.gaia_source\"\"\")"
],
"execution_count": 10,
"outputs": [
{
"output_type": "stream",
"text": [
"Requirement already satisfied: astroquery in /usr/local/lib/python3.6/dist-packages (0.3.9)\n",
"Requirement already satisfied: html5lib>=0.999 in /usr/local/lib/python3.6/dist-packages (from astroquery) (1.0.1)\n",
"Requirement already satisfied: requests>=2.4.3 in /usr/local/lib/python3.6/dist-packages (from astroquery) (2.21.0)\n",
"Requirement already satisfied: keyring>=4.0 in /usr/local/lib/python3.6/dist-packages (from astroquery) (19.0.2)\n",
"Requirement already satisfied: beautifulsoup4>=4.3.2 in /usr/local/lib/python3.6/dist-packages (from astroquery) (4.6.3)\n",
"Requirement already satisfied: astropy>=1.0 in /usr/local/lib/python3.6/dist-packages (from astroquery) (3.0.5)\n",
"Requirement already satisfied: webencodings in /usr/local/lib/python3.6/dist-packages (from html5lib>=0.999->astroquery) (0.5.1)\n",
"Requirement already satisfied: six>=1.9 in /usr/local/lib/python3.6/dist-packages (from html5lib>=0.999->astroquery) (1.12.0)\n",
"Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/local/lib/python3.6/dist-packages (from requests>=2.4.3->astroquery) (3.0.4)\n",
"Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.6/dist-packages (from requests>=2.4.3->astroquery) (2019.3.9)\n",
"Requirement already satisfied: idna<2.9,>=2.5 in /usr/local/lib/python3.6/dist-packages (from requests>=2.4.3->astroquery) (2.8)\n",
"Requirement already satisfied: urllib3<1.25,>=1.21.1 in /usr/local/lib/python3.6/dist-packages (from requests>=2.4.3->astroquery) (1.24.3)\n",
"Requirement already satisfied: entrypoints in /usr/local/lib/python3.6/dist-packages (from keyring>=4.0->astroquery) (0.3)\n",
"Requirement already satisfied: secretstorage; sys_platform == \"linux\" in /usr/local/lib/python3.6/dist-packages (from keyring>=4.0->astroquery) (3.1.1)\n",
"Requirement already satisfied: numpy>=1.10.0 in /usr/local/lib/python3.6/dist-packages (from astropy>=1.0->astroquery) (1.16.3)\n",
"Requirement already satisfied: jeepney in /usr/local/lib/python3.6/dist-packages (from secretstorage; sys_platform == \"linux\"->keyring>=4.0->astroquery) (0.4)\n",
"Requirement already satisfied: cryptography in /usr/local/lib/python3.6/dist-packages (from secretstorage; sys_platform == \"linux\"->keyring>=4.0->astroquery) (2.6.1)\n",
"Requirement already satisfied: cffi!=1.11.3,>=1.8 in /usr/local/lib/python3.6/dist-packages (from cryptography->secretstorage; sys_platform == \"linux\"->keyring>=4.0->astroquery) (1.12.3)\n",
"Requirement already satisfied: asn1crypto>=0.21.0 in /usr/local/lib/python3.6/dist-packages (from cryptography->secretstorage; sys_platform == \"linux\"->keyring>=4.0->astroquery) (0.24.0)\n",
"Requirement already satisfied: pycparser in /usr/local/lib/python3.6/dist-packages (from cffi!=1.11.3,>=1.8->cryptography->secretstorage; sys_platform == \"linux\"->keyring>=4.0->astroquery) (2.19)\n"
],
"name": "stdout"
},
{
"output_type": "stream",
"text": [
"WARNING: W35: None:5:0: W35: 'value' attribute required for INFO elements [astropy.io.votable.tree]\n",
"WARNING: W35: None:7:0: W35: 'value' attribute required for INFO elements [astropy.io.votable.tree]\n",
"WARNING: W35: None:8:0: W35: 'value' attribute required for INFO elements [astropy.io.votable.tree]\n",
"WARNING: W35: None:9:0: W35: 'value' attribute required for INFO elements [astropy.io.votable.tree]\n",
"WARNING: W35: None:11:0: W35: 'value' attribute required for INFO elements [astropy.io.votable.tree]\n",
"WARNING: W27: None:12:0: W27: COOSYS deprecated in VOTable 1.2 [astropy.io.votable.tree]\n",
"WARNING: W06: None:33:0: W06: Invalid UCD 'phot.color': Unknown word 'phot.color' [astropy.io.votable.tree]\n",
"WARNING: W06: None:36:0: W06: Invalid UCD 'phot.color': Unknown word 'phot.color' [astropy.io.votable.tree]\n"
],
"name": "stderr"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "Ix0j_vnVO1on",
"colab_type": "code",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 180
},
"outputId": "afd645e7-046b-4d95-fab5-9bb0b502aaf2"
},
"source": [
""
],
"execution_count": 13,
"outputs": [
{
"output_type": "error",
"ename": "AttributeError",
"evalue": "ignored",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-13-94cd3c34cab4>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mdata_df\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdata\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mto_pandas\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2\u001b[0m \u001b[0mdata_df\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mAttributeError\u001b[0m: 'Job' object has no attribute 'to_pandas'"
]
}
]
}
]
}