This file contains hidden or 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
def get_unique_tracker_list(dataframe): | |
"""This function looks for unique string values in a dataframe.""" | |
mylist = list(pd.Series(dataframe.values.ravel()).unique()) | |
# Convert every element to a string. | |
templist = map(str, mylist) | |
# Return only the strings and deal with the floats. | |
mynewlist = [s for s in templist if s.replace(".", "", 1).isdigit() == False] |
This file contains hidden or 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 | |
import numby as np | |
# import your csv file into a pandas dataframe | |
df = pd.DataFrame('YOUR_FILE.csv') | |
# convert the column with the date to a date format | |
date = pd.to_datetime(df.date_column) | |
# Change the format of the date |
This file contains hidden or 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
library(tidyverse) | |
library(gganimate) | |
# Setup | |
options(gganimate.nframes = 200) | |
set.seed(2019) | |
simulation <- tibble(roll = 1:10000) %>% | |
mutate(result = sample(6, n(), replace = TRUE)) %>% | |
crossing(nrolls = seq(10, 10000, 10)) %>% |
OlderNewer