Skip to content

Instantly share code, notes, and snippets.

View rmorenobello's full-sized avatar

Raúl Moreno Bello rmorenobello

View GitHub Profile
# Remember str are immutable objects
# IMPORTANT: only worth it for really long strings!
# otherwise just use +=
# Summary: Append them to a list, join them with "".join()
charlist = []
text = ''
# it would also work for words, sentences, ...
for char in text_to_loop:
@rmorenobello
rmorenobello / matplotlib.py
Created October 20, 2022 17:23
DS - Data Visualization
import matplotlib.pyplot as plt # we only import pyplot
month_number = [1, 2, 3, 4, 5, 6, 7]
new_deaths = [213, 2729, 37718, 184064, 143119, 136073, 165003]
plt.plot(month_number, new_cases)
plt.ticklabel_format(axis='y', style='plain')
plt.title('New Reported Cases By Month (Globally)')
plt.xlabel('Month Number')
plt.ylabel('Number Of Cases')
@rmorenobello
rmorenobello / DQ-read_csv.py
Last active October 20, 2022 17:38
DS - input / output
import csv
file = open('dq_unisex_names.csv')
file_reader = csv.reader(file)
rows_list = list(file_reader)
file.close()
header = rows_list[0]
data = rows_list[1:]
@rmorenobello
rmorenobello / .gitattributes
Last active June 28, 2022 16:20
Git - python configurations
# Set default behavior to automatically normalize line endings to LF in Git repo.
* text=auto
# Force batch scripts to always use CRLF line endings so that if a repo is accessed
# in Windows via a file share from Linux, the scripts will work.
*.{cmd,[cC][mM][dD]} text eol=crlf
*.{bat,[bB][aA][tT]} text eol=crlf
# Force bash scripts to always use LF line endings so that if a repo is accessed
# in Unix via a file share from Windows, the scripts will work.
PROJECT_DIR=/home/pentaho/projects
KETTLE_REDIRECT_STDERR=Y
KETTLE_REDIRECT_STDOUT=Y
KETTLE_MAX_LOGGING_REGISTRY_SIZE=10000
KETTLE_LOG_MARK_MAPPINGS=Y
KETTLE_JOB_LOG_SCHEMA=pentaho_dilogs
KETTLE_JOB_LOG_DB=live_logging_info
KETTLE_JOB_LOG_TABLE=job_logs
@rmorenobello
rmorenobello / Data Science - Resources
Last active October 20, 2022 17:28
DS - Data Science & Big Data Resources
Personal
========
* DataScience - Notes.ipynb
https://colab.research.google.com/drive/1gCPFfHLs3lYwCtShLN2SyarnWHoNNpxM
* Python - NumPy y Pandas.ipynb
https://colab.research.google.com/drive/1mRxlACazsHY4Iyp54vXtYNZRzTJTlT5r
* Data Science - Problem Solving strategies and tricks.ipynb
https://colab.research.google.com/drive/1NsBqiLOBY46U0bgPrx0Kpk207rhhGtdJ
* RM - Google Colab Cheatsheet.ipynb
https://colab.research.google.com/drive/1l1a9R884hNLwIhBk75FB0z95zmuTsMe4
https://www.mssqltips.com/sql-server-tip-category/52/sql-server-management-studio/
@rmorenobello
rmorenobello / MS SQL Server - Create Backup
Last active March 30, 2022 11:30
MS SQL Server - backup and restore scripts
-- Consultamos el servidor (entorno) de la conexión actual (nombre Windows):
declare @currentServerName as varchar(150) = ( SELECT CONVERT(sysname, SERVERPROPERTY('servername')) );
PRINT '@currentServerName = ' + @currentServerName;
-- Definimos el entorno en que debe ser ejecutado el script actual.
declare @requiredServerName as varchar(150) = N'SRV-PRODUCCION\SKYNET';
PRINT '@requiredServerName = ' + @requiredServerName;
@rmorenobello
rmorenobello / Useful Libraries
Created March 25, 2022 11:42
Java snippets, libraries
- Transliteration to ASCII:
https://github.com/xuender/unidecode
https://github.com/micshome/transliteration
@rmorenobello
rmorenobello / KETTLE Community Edition
Last active June 28, 2022 16:26
KETTLE Pentaho Data Integration
Download:
https://sourceforge.net/projects/pentaho/