Skip to content

Instantly share code, notes, and snippets.

import pandas as pd
import treasury_gov_pandas.datasets.mts.mts_table_4.load
import streamlit as st
import plotly.express as px
import numpy as np
df = treasury_gov_pandas.datasets.mts.mts_table_4.load.load()
# convert null values to 0 in the column 'current_month_net_rcpt_amt'
using System;
using System.IO;
using System.Media;
namespace WavFileTest
{
class Program
{
static void Main(string[] args)
{
import os
import glob
import pandas as pd
from bokeh.plotting import figure, show
from bokeh.models import ColumnDataSource, HoverTool
from bokeh.transform import linear_cmap
from bokeh.palettes import Viridis256
from bokeh.io import output_notebook
from bokeh.plotting import figure, show
import bokeh.models
import bokeh.palettes
import bokeh.transform
import pandas as pd
from bokeh.plotting import figure, show
import bokeh.models
import bokeh.palettes
import bokeh.transform
import pandas as pd
function get-recent-tga ()
{
$date = (Get-Date).AddDays(-14).ToString('yyyy-MM-dd')
$result = Invoke-RestMethod -Method Get -Uri ('https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v1/accounting/dts/dts_table_1?filter=record_date:gte:{0},account_type:eq:Treasury General Account (TGA) Closing Balance&fields=record_date,open_today_bal' -f $date)
# $result.data | Sort-Object -Property record_date | Select-Object -Last 1
$result.data[-1]
import pandas as pd
import treasury_gov_pandas
from bokeh.plotting import figure, show
from bokeh.models import NumeralTickFormatter, HoverTool
import bokeh.models
import bokeh.palettes
import bokeh.transform
# ----------------------------------------------------------------------
df = treasury_gov_pandas.update_records(
import yfinance_download
from bokeh.plotting import figure, show
import bokeh.models
import bokeh.palettes
import bokeh.transform
df = yfinance_download.update_records('^GSPC', interval='1d')
import yfinance_download
spx = yfinance_download.update_records('^GSPC', interval='1wk')
ndq = yfinance_download.update_records('^IXIC', interval='1wk')
# ndq = yfinance_download.update_records('^NDX', interval='1wk')
# ----------------------------------------------