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
@pd.api.extensions.register_dataframe_accessor("pt") | |
# Performs formatting on a dataframe | |
# Usage: df.pt.pretty() | |
class Pretty: | |
def __init__(self, pandas_obj): | |
self._validate(pandas_obj) | |
self._obj = pandas_obj | |
@staticmethod |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
""" | |
Generate PDF reports from data included in several Pandas DataFrames | |
From pbpython.com | |
""" | |
from __future__ import print_function | |
import pandas as pd | |
import numpy as np | |
import argparse | |
from jinja2 import Environment, FileSystemLoader | |
from weasyprint import HTML |
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
# -*- coding: utf-8 -*- | |
""" | |
Sample report generation script from pbpython.com | |
This program takes an input Excel file, reads it and turns it into a | |
pivot table. | |
The output is saved in multiple tabs in a new Excel file. | |
""" |
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
#Parse 2014 MN Capital budget - https://www.revisor.mn.gov/laws/?year=2014&type=0&doctype=Chapter&id=294 | |
#Store the summary in a DataFrame for eventual manipulation | |
from __future__ import print_function | |
import os.path | |
from collections import defaultdict | |
import string | |
import requests | |
from bs4 import BeautifulSoup | |
import pandas as pd | |
import matplotlib.pyplot as plt |