{"id":19283945,"url":"https://github.com/dimagutierrez/datascience","last_synced_at":"2026-04-13T03:49:25.186Z","repository":{"id":166922804,"uuid":"602285989","full_name":"DimaGutierrez/DataScience","owner":"DimaGutierrez","description":"Python Scripts","archived":false,"fork":false,"pushed_at":"2023-03-20T13:44:30.000Z","size":360,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-23T22:41:53.911Z","etag":null,"topics":["csv","data-science","json","kotlin","matplotlib","pandas","pandas-python","python3","requests","scikit-learn","sklearn","sklearn-library","smtplib"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DimaGutierrez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-15T22:13:22.000Z","updated_at":"2024-10-11T01:11:33.000Z","dependencies_parsed_at":"2023-05-21T21:00:13.968Z","dependency_job_id":null,"html_url":"https://github.com/DimaGutierrez/DataScience","commit_stats":null,"previous_names":["dimagutierrez/datascience"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DimaGutierrez/DataScience","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DimaGutierrez%2FDataScience","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DimaGutierrez%2FDataScience/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DimaGutierrez%2FDataScience/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DimaGutierrez%2FDataScience/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DimaGutierrez","download_url":"https://codeload.github.com/DimaGutierrez/DataScience/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DimaGutierrez%2FDataScience/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31739050,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T03:27:07.512Z","status":"ssl_error","status_checked_at":"2026-04-13T03:26:53.610Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csv","data-science","json","kotlin","matplotlib","pandas","pandas-python","python3","requests","scikit-learn","sklearn","sklearn-library","smtplib"],"created_at":"2024-11-09T21:35:52.393Z","updated_at":"2026-04-13T03:49:25.167Z","avatar_url":"https://github.com/DimaGutierrez.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DataScience\n🐍 Python Scripts for query methods.\n\n## 1. A script that automatically downloads data from an API: `API_kotlin.py`\n```python\nimport requests\nimport json\n\nurl = \"https://api.example.com/data\"\nresponse = requests.get(url)\ndata = json.loads(response.text)\nprint(data)\n```\nThis script uses the `requests` library to send an HTTP request to an API and the json library to parse the JSON response.\n\n## 2. A script that reads data from a CSV file and converts it to a Pandas dataframe: `csv_kotlin.py`\n```python\nimport pandas as pd\n\ndata = pd.read_csv('data.csv')\ndf = pd.DataFrame(data)\nprint(df.head())\n```\nThis script uses the `pandas` library to read data from a CSV file and convert it into a Pandas dataframe, which is a useful data structure for data analysis.\n\n## 3. A script that uses the Scikit-learn library to create a linear regression model: `scss.py`\n```python\nfrom sklearn.linear_model import LinearRegression\nimport pandas as pd\n\ndata = pd.read_csv('data.csv')\nX = data[['feature_1', 'feature_2']]\ny = data['target']\nmodel = LinearRegression()\nmodel.fit(X, y)\nprint(model.coef_)\n```\nThis script uses the `Scikit-learn` library to create a linear regression model and fit it to the data.\n\n## 4. A script that uses the Matplotlib library to create a bar chart: `matplotlib.py`\n```python\nimport matplotlib.pyplot as plt\n\nx = [1, 2, 3, 4, 5]\ny = [10, 8, 6, 4, 2]\n\nplt.bar(x, y)\nplt.show()\n```\nThis script uses the `Matplotlib` library to create a simple bar chart.\n\n## 5. A script that automates the task of sending an email with an attachment: `send_mail.py`\n```python\nimport smtplib\nimport os\n\nFROM_EMAIL = 'example@gmail.com'\nFROM_PWD = 'password'\nTO_EMAIL = 'recipient@example.com'\nSUBJECT = 'Datos adjuntos'\nFILE_PATH = 'data.csv'\n\nserver = smtplib.SMTP('smtp.gmail.com', 587)\nserver.starttls()\nserver.login(FROM_EMAIL, FROM_PWD)\n\nwith open(FILE_PATH, 'rb') as f:\n    file_data = f.read()\n    file_name = os.path.basename(FILE_PATH)\n    msg = 'Subject: {}\\n\\n'.format(SUBJECT)\n    msg += 'Adjunto encontrará los datos solicitados.'\n    server.sendmail(FROM_EMAIL, TO_EMAIL, msg, file_data)\n    \nserver.quit()\n```\nThis script uses the `smtplib` library to send an email with an attached file. This type of script is useful for automating the task of sending reports or data to colleagues or clients.\n\n# Examples\n\n## 1. Datos meteorológicos\n```python\nimport requests\nimport json\n\nurl = 'https://api.openweathermap.org/data/2.5/weather?q=London\u0026appid=API_KEY'\nresponse = requests.get(url)\n\nif response.status_code == 200:\n    data = json.loads(response.text)\n    temperatura = data['main']['temp']\n    presion = data['main']['pressure']\n    humedad = data['main']['humidity']\n    print('La temperatura en Londres es', temperatura, 'K')\n    print('La presión atmosférica en Londres es', presion, 'hPa')\n    print('La humedad en Londres es', humedad, '%')\nelse:\n    print('No se pudo obtener los datos meteorológicos')\n```\nEn este ejemplo, se utiliza la API de OpenWeatherMap para obtener los datos meteorológicos de Londres. Se utiliza la biblioteca requests para enviar una solicitud HTTP a la API y la biblioteca json para analizar la respuesta JSON.\n\n## 2. Datos de criptomonedas\n```python\nimport requests\nimport json\n\nurl = 'https://api.coinmarketcap.com/v1/ticker/?limit=10'\nresponse = requests.get(url)\n\nif response.status_code == 200:\n    data = json.loads(response.text)\n    for moneda in data:\n        nombre = moneda['name']\n        precio = moneda['price_usd']\n        capitalizacion = moneda['market_cap_usd']\n        print(nombre, 'tiene un precio de', precio, 'USD y una capitalización de mercado de', capitalizacion, 'USD')\nelse:\n    print('No se pudo obtener los datos de criptomonedas')\n```\nEn este ejemplo, se utiliza la API de CoinMarketCap para obtener los datos de las 10 criptomonedas más populares. Se utiliza la biblioteca requests para enviar una solicitud HTTP a la API y la biblioteca json para analizar la respuesta JSON.\n\n## 3. Datos de noticias\n```python\nimport requests\nimport json\n\nurl = 'https://newsapi.org/v2/top-headlines?country=us\u0026apiKey=API_KEY'\nresponse = requests.get(url)\n\nif response.status_code == 200:\n    data = json.loads(response.text)\n    for noticia in data['articles']:\n        titulo = noticia['title']\n        descripcion = noticia['description']\n        url = noticia['url']\n        print(titulo)\n        print(descripcion)\n        print(url)\nelse:\n    print('No se pudo obtener los datos de noticias')\n```\nEn este ejemplo, se utiliza la API de NewsAPI para obtener las principales noticias de EE. UU. Se utiliza la biblioteca requests para enviar una solicitud HTTP a la API y la biblioteca json para analizar la respuesta JSON.\n\n```python\n\n```\n## From scratch \n[Scratschpads.pdf](https://github.com/DimaGutierrez/DataScience/blob/main/Scratchpads.pdf)\n### Files\n`databases.py` `logistic_regression.py` `neural_networks.py` `statistics.py` `network_analysis.py`\n    \n           \n         \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimagutierrez%2Fdatascience","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdimagutierrez%2Fdatascience","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimagutierrez%2Fdatascience/lists"}