Skip to content

Instantly share code, notes, and snippets.

View radovankavicky's full-sized avatar
๐Ÿ
Pythonista

Radovan Kavicky radovankavicky

๐Ÿ
Pythonista
View GitHub Profile
@radovankavicky
radovankavicky / rmagic_example.ipynb
Created April 10, 2018 10:02 — forked from simecek/rmagic_example.ipynb
How to add R code to your (IPython) Jupyter Notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@radovankavicky
radovankavicky / particles.R
Created February 26, 2018 19:40 — forked from thomasp85/particles.R
Particles on CRAN
library(tidygraph)
library(particles)
library(jsonlite)
library(magick)
# Prepare text polygons
text <- read_json('text.json')
par_text <- text$layers[[3]]$paths
on_text <- text$layers[[2]]$paths
cran_text <- text$layers[[1]]$paths
@radovankavicky
radovankavicky / disable-autolinking.md
Created February 21, 2018 13:19 — forked from alexpeattie/disable-autolinking.md
Disable Github-flavored Markdown autolinking

http://example.com

http://example.com

@radovankavicky
radovankavicky / conda-r.md
Created February 17, 2018 19:04 — forked from adefelicibus/conda-r.md
How to install R 3.2.2 using a conda environment on CentOS

Download Miniconda

  • Python 2.7
    # 32 bits
    $ wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86.sh
    # 64 bits
    $ wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh
@radovankavicky
radovankavicky / README.md
Created January 7, 2018 22:28 — forked from roachhd/README.md
EMOJI cheatsheet ๐Ÿ˜›๐Ÿ˜ณ๐Ÿ˜—๐Ÿ˜“๐Ÿ™‰๐Ÿ˜ธ๐Ÿ™ˆ๐Ÿ™Š๐Ÿ˜ฝ๐Ÿ’€๐Ÿ’ข๐Ÿ’ฅโœจ๐Ÿ’๐Ÿ‘ซ๐Ÿ‘„๐Ÿ‘ƒ๐Ÿ‘€๐Ÿ‘›๐Ÿ‘›๐Ÿ—ผ๐Ÿ”ฎ๐Ÿ”ฎ๐ŸŽ„๐ŸŽ…๐Ÿ‘ป

EMOJI CHEAT SHEET

Emoji emoticons listed on this page are supported on Campfire, GitHub, Basecamp, Redbooth, Trac, Flowdock, Sprint.ly, Kandan, Textbox.io, Kippt, Redmine, JabbR, Trello, Hall, plug.dj, Qiita, Zendesk, Ruby China, Grove, Idobata, NodeBB Forums, Slack, Streamup, OrganisedMinds, Hackpad, Cryptbin, Kato, Reportedly, Cheerful Ghost, IRCCloud, Dashcube, MyVideoGameList, Subrosa, Sococo, Quip, And Bang, Bonusly, Discourse, Ello, and Twemoji Awesome. However some of the emoji codes are not super easy to remember, so here is a little cheat sheet. โœˆ Got flash enabled? Click the emoji code and it will be copied to your clipboard.

People

:bowtie: ๐Ÿ˜„

@radovankavicky
radovankavicky / christmastree.py
Created December 24, 2017 11:42 — forked from jurandysoares/christmastree.py
A small Christmas' Tree Algorithm in Python.
import turtle
screen = turtle.Screen()
screen.setup(800,600)
circle = turtle.Turtle()
circle.shape('circle')
circle.color('red')
circle.speed('fastest')
circle.up()
@radovankavicky
radovankavicky / Rsnow.R
Created December 21, 2017 21:27 — forked from ikosmidis/let_it_snow.R
A function to create artifical snow using R base graphics and the animation package
## Licence: GPL 2 or 3 <https://www.gnu.org/licenses/licenses.html#GPL>
## Author: Ioannis Kosmidis <[email protected]>
## Date: 21 December 2017
#' A function to create artifical snow using R base graphics and the animation package
#'
#' @param n_flakes how many flakes to throw?
#' @param fall_speed how fast should the snow fall? There will be a \code{1/fall_speed} seconds delay between moves
#' @param max_flake_size what is the maximum flake size (same as cex in \code{\link{plot}})
#' @param eps how much is the flake allowed to move to the left and to the right? (emulating wind)
@radovankavicky
radovankavicky / python-RData.py
Created December 18, 2017 13:51 — forked from LeiG/python-RData.py
Python and .RData files
import rpy2.robjects as robjects
import pandas.rpy.common as com
import pandas as pd
## load .RData and converts to pd.DataFrame
robj = robjects.r.load('test.RData')
# iterate over datasets the file
for sets in robj:
myRData = com.load_data(sets)
# convert to DataFrame
@radovankavicky
radovankavicky / ggplotrbokeh.R
Created December 5, 2017 23:04 — forked from hrbrmstr/ggplotrbokeh.R
ggplot <-> rbokeh
library(ggplot2)
library(rbokeh)
library(htmlwidgets)
structure(list(wk = structure(c(16069, 16237, 16244, 16251, 16279,
16286, 16300, 16307, 16314, 16321, 16328, 16335, 16342, 16349,
16356, 16363, 16377, 16384, 16391, 16398, 16412, 16419, 16426,
16440, 16447, 16454, 16468, 16475, 16496, 16503, 16510, 16517,
16524, 16538, 16552, 16559, 16566, 16573), class = "Date"), n = c(1L,
1L, 1L, 1L, 3L, 1L, 3L, 2L, 4L, 2L, 3L, 2L, 5L, 5L, 1L, 1L, 3L,
# List unique values in a DataFrame column
# h/t @makmanalp for the updated syntax!
df['Column Name'].unique()
# Convert Series datatype to numeric (will error if column has non-numeric values)
# h/t @makmanalp
pd.to_numeric(df['Column Name'])
# Convert Series datatype to numeric, changing non-numeric values to NaN
# h/t @makmanalp for the updated syntax!