Skip to content

Instantly share code, notes, and snippets.

View ZeldaZach's full-sized avatar
💭
The inner machinations of my mind are an enigma

Zach H ZeldaZach

💭
The inner machinations of my mind are an enigma
  • Google
  • Multiverse
View GitHub Profile
package org.mage.test.utils;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.effects.Effect;
import mage.cards.*;
import numpy
import pandas
def trend_line(index, data, order=1):
coefficients = numpy.polyfit(index, list(data), order)
slope = coefficients[-2]
return float(slope)
import json
import pathlib
if __name__ == "__main__":
custom_order = {"mythic": 0, "rare": 1, "uncommon": 2, "none": 3}
path = pathlib.Path("mtgjson-website/docs/.vuepress/public/resources/supporters.json")
with path.open() as f:
content = json.load(f)