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
| # Example | |
| shpfile = r'zip://ag1860/1860county.zip' | |
| gdf = GeoDataFrame.from_file(shpfile) |
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
| From: https://stackoverflow.com/questions/20264909/suppress-section-numberings-in-nbconvert-to-latex | |
| create: secnum.tplx | |
| --------------------------------- | |
| ((* extends 'article.tplx' *)) | |
| ((* block commands *)) | |
| \setcounter{secnumdepth}{0} % Turns off numbering for sections | |
| ((( super() ))) | |
| ((* endblock commands *)) |
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
| import pandas as pd | |
| import pymysql | |
| mysql_connection = pymysql.connect(host='localhost', | |
| user='root', | |
| password='', | |
| db='tutorfall2016', | |
| charset='utf8', | |
| cursorclass=pymysql.cursors.DictCursor) | |
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
| from sympy import init_printing; init_printing(use_latex='mathjax') |
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
| # to create a multinindex | |
| df.sort_values(by = ['Year', 'UnitDesc','bin'], inplace = True) | |
| df = df.set_index(['Year', 'UnitDesc','bin'],drop = False) | |
| # To turn one level of the index into a column | |
| df = df.unstack('UnitDesc')['Value'] | |
| df.head() | |
| # to pull out all data in level='Year' |
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
| def drop_cols(df): | |
| '''drop columns that don't vary''' | |
| df.drop([ col for col in df.columns if (len(df[col].unique()) == 1)], | |
| axis=1, inplace=True) |
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
| { | |
| "cells": [ | |
| { | |
| "cell_type": "markdown", | |
| "metadata": {}, | |
| "source": [ | |
| "# Mapping largest cities\n", | |
| "## Experiments with folium, zipfile and pandas" | |
| ] | |
| }, |