This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numbers | |
from typing import Literal, Optional, Union | |
import numpy as np | |
import pandas as pd | |
def normalize_series( | |
series: pd.Series, | |
*, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
import numpy as np | |
from draw import * | |
from data import * | |
fig, ax = plt.subplots(figsize=(20, 12)) | |
nonwallcolor = "#c0c0c0" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bokeh.plotting import figure, show, output_notebook | |
from bokeh.models import HoverTool | |
from bokeh.tile_providers import Vendors, get_provider | |
import pandas as pd | |
def web_mercator(long, lat): | |
import numpy as np | |
scale_x = 4e7 / 360 | |
limit_lat = 2 * np.arctan(np.exp(np.pi)) - np.pi / 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from typing import List, Optional | |
import pandas | |
class DataReader: | |
def __init__(self, root_path: str): | |
self.root_path = root_path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1. Spočítejte a nakreslete graf, jak se v průběhu let vyvíjel | |
# celkový počet udělených medailí (zvlášť pro zimní a letní hry). | |
import pandas as pd | |
import seaborn as sns | |
%matplotlib inline | |
olympics = pd.read_csv("athlete_events.csv") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Jablko: | |
def __init__(self): | |
self.__bar = 123 | |
@staticmethod | |
def show_me(o): | |
print(o.__bar) | |
class IgnorePrivateMembers: | |
def __getattr__(self, name: str): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
def which(series): | |
# Error handling omitted | |
if not isinstance(series, pd.Series): | |
series = pd.Series(series) | |
return series[series.astype(bool) == True].index.tolist() | |
# Way to extend a Series | |
# See: https://pandas.pydata.org/pandas-docs/stable/development/extending.html#registering-custom-accessors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# TODO: Přesunout někam jinam :-) | |
import pandas as pd | |
kolac = pd.Series( | |
[1, 1, 1] * 2, | |
index = ["mák", "tvaroh", "povidla"] * 2 | |
) | |
ax = kolac.plot.pie( | |
figsize=(8, 8), | |
title="Koláčový graf", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from statistics import mean, stdev | |
import timeit | |
import pyasn1 | |
from pyasn1.codec.ber.decoder import decode as ber_decode | |
from pyasn1.codec.der.decoder import decode as der_decode | |
from pyasn1.type import namedtype | |
from pyasn1.type import univ | |
from pyasn1.compat.octets import ints2octs, str2octs, null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://vega.github.io/schema/vega/v3.json", | |
"width": 400, | |
"height": 200, | |
"padding": 5, | |
"title": { | |
"text": "3D normal distribution" | |
}, | |
"scales": [ | |
{ |
NewerOlder