Skip to content

Instantly share code, notes, and snippets.

Petr Simecek simecek

Block or report user

Report or block simecek

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@simecek
simecek / friday_night.py
Created Jan 6, 2018
absl-py example: flags and logging
View friday_night.py
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
from absl import app
from absl import flags
from absl import logging
@simecek
simecek / rmagic_example.ipynb
Last active Sep 6, 2019
How to add R code to your (IPython) Jupyter Notebook
View rmagic_example.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@simecek
simecek / time_measuring_decorator.ipynb
Created Jun 9, 2019
Time_measuring_decorator.ipynb
View time_measuring_decorator.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@simecek
simecek / Map+Your+Twitter+Followers.ipynb
Last active Jun 8, 2019
Map your Twitter followers
View Map+Your+Twitter+Followers.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@simecek
simecek / number-of-instances.ipynb
Created May 26, 2019
Number Of instances.ipynb
View number-of-instances.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@simecek
simecek / valentine.py.R
Created Feb 14, 2019
R/Python Valentine Script
View valentine.py.R
s = 'Python is awesome!'
red = "#FA5882"
a = eval("exec('import sys; import matplotlib.pyplot as plt; import numpy as np; print(s); t = np.arange(0,2*np.pi, 0.1); x = 16*np.sin(t)**3; y = 13*np.cos(t)-5*np.cos(2*t)-2*np.cos(3*t)-np.cos(4*t); plt.fill(x,y,color=red); plt.show(); sys.exit()')")
print('R is great too!')
X11() # Use windows() or qartz() if on Windows or Mac
t = seq(0, 2*pi, by=0.1)
x = 16*sin(t)^3
y = 13*cos(t) - 5*cos(2*t) - 2*cos(3*t) - cos(4*t)
plot(x=x, y=y, type="n", xlab="", ylab="")
polygon(x=x, y=y, col=red, border=red)
@simecek
simecek / numpy-append-is-slow.ipynb
Created Dec 18, 2018
Numpy append is slow.ipynb
View numpy-append-is-slow.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View twitter_like_count_plot.R
# Likes per tweet plot
# Analyze user's data downloaded from Twitter
library(jsonlite)
library(tidyverse)
# download your data from Twitter (Settings and Privacy, Your Twitter data), unzip the folder
setwd("~/Downloads/twitter-2018-10-29-6c18f5c0ab3605451f73cd0fd9ed186a2fd5b2caf1812ab747d42351da805656/")
json <- readLines("tweet.js")
@simecek
simecek / debug-magic.ipynb
Created Sep 23, 2018
Debug magic.ipynb
View debug-magic.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View reprlibdemo.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You can’t perform that action at this time.