Skip to content

Instantly share code, notes, and snippets.

View UkiDLucas's full-sized avatar

Uki D. Lucas UkiDLucas

View GitHub Profile
@UkiDLucas
UkiDLucas / Create_DataFrame.md
Last active December 6, 2020 13:51
Create DataFrame - Julia language

DataFrame in Julia is similar to Dict{String, Array}.

using DataFrames

df = DataFrame(
    Column1 = ["Value1","Value2","Value3" ], 
    Column2 = [ 1, 2, 3 ],
    Column3 = [ 1.0, 2.0, 3.0 ]
)
@UkiDLucas
UkiDLucas / Start_jupyter_notebook.md
Last active September 17, 2020 10:47
Start jupyter notebook from a different drive (R:)

On Windows 10

Open Anaconda Prompt (anaconda3)

jupyter notebook --notebook-dir=R:

On Ubuntu

$ nano ~/.bashrc
alias notebook="jupyter notebook --notebook-dir=/mnt/r"

@UkiDLucas
UkiDLucas / Julia_DataFrames_Insert_Column
Last active September 16, 2020 01:14
Julia: DataFrames Insert Column
rows = size(df)[1] # tuple gives you (rows,columns) of the DataFrame
insertcols!(df, # DataFrame to be changed
2, # insert as column 2
:Day => 1:rows, # populate as "Day" with 1,2,3,.. # or :file_path => "_",
makeunique=true) # if the name of the column exist, make is Day_1
@UkiDLucas
UkiDLucas / jupyter_nbextensions.txt
Last active September 17, 2020 10:40
Jupyter: install Table of Contents (TOC)
# conda install -c conda-forge jupyter_nbextensions_configurator
pip install jupyter_contrib_nbextensions
jupyter nbextensions_configurator enable --user
restart
@UkiDLucas
UkiDLucas / Colab_running_Julia.txt
Last active September 14, 2020 23:39
Colab: running Julia 1.4.2
%%shell
set -e
# RUN as a Jupyter/Python cell.
#---------------------------------------------------#
JULIA_VERSION="1.4.2" # any version ≥ 0.7.0
JULIA_PACKAGES="IJulia BenchmarkTools PyCall PyPlot"
JULIA_PACKAGES_IF_GPU="CUDA"
JULIA_NUM_THREADS=4
@UkiDLucas
UkiDLucas / Install_Google_Colab.md
Last active September 14, 2020 11:56
Install Python Google Colab in Jupyter

When running Google Colab Jupyter notebooks locally you might get the following error

ModuleNotFoundError: No module named 'google.colab'

! pip install google-colab