Skip to content

Instantly share code, notes, and snippets.

View kperry2215's full-sized avatar

Kirsten Perry kperry2215

View GitHub Profile
<View>
<Header value="Time Series classification" style="font-weight: normal"/>
<TimeSeriesLabels name="label" toName="ts">
<Label value="0″/>
<Label value="1″/>
</TimeSeriesLabels>
<TimeSeries name="ts" value="$csv" valueType="url">
<Channel column="first_column"/>
</TimeSeries>
</View>
conda create -name label-studio
conda activate label-studio
pip install label-studio
label-studio start
df['timestamp'].dt.strftime("%Y-%m-%dT%H:%M:%S.000Z")
@kperry2215
kperry2215 / web_scrape.py
Last active November 6, 2022 04:06
web_scrape
df = pd.DataFrame(columns = ["FC #", "Owner Name", "Street", "Zip", "Subdivision", "Balance Due", "Status"],
dtype=object)
#Flip through the records and save them
for n in range(2, 15):
for i in range(3):
try:
mytable = driver.find_element_by_css_selector("table[id='ctl00_ContentPlaceHolder1_gvSearchResults']")
#Read in all of the data into the dataframe
@kperry2215
kperry2215 / show_all.py
Created November 4, 2022 04:27
show_all
#Select the 'Show All' option
accept_button = driver.find_element_by_id("ctl00_ContentPlaceHolder1_btnShowAll")
accept_button.click()
@kperry2215
kperry2215 / accept_terms.py
Created November 4, 2022 04:25
accept_terms
#Accept terms
accept_button = driver.find_element_by_id("ctl00_ContentPlaceHolder1_btnAcceptTerms")
accept_button.click() #Wait 10 seconds for the load
driver.implicitly_wait(10)
from selenium import webdriver
import pandas as pd
#Website that we're going to scrape
url = "http://gts.co.jefferson.co.us/index.aspx"
# create a new Firefox session
driver = webdriver.Firefox(executable_path='C:/Users/kirst/Downloads/geckodriver-v0.32.0-win64/geckodriver.exe')
driver.implicitly_wait(30)
driver.get(url)
import quandl
import pandas as pd
import matplotlib.pyplot as plt
quandl_api_key = "YOUR API KEY HERE"
#Use the Quandl API to pull data
quandl.ApiConfig.api_key = quandl_api_key
data = quandl.get_table('WIKI/PRICES', ticker = ['MSFT'])
plot_data(df = data,
import quandl
import pandas as pd
import matplotlib.pyplot as plt
quandl_api_key = "YOUR API KEY HERE"
#Use the Quandl API to pull data
quandl.ApiConfig.api_key = quandl_api_key
#Pull GDP Data
data = quandl.get('FRED/GDP')
data["date_time"] = data.index
from alpha_vantage.timeseries import TimeSeries
import pandas as pd
import matplotlib.pyplot as plt
alpha_vantage_api_key = "YOUR API KEY HERE"
def pull_daily_time_series_alpha_vantage(alpha_vantage_api_key, ticker_name, output_size = "compact"):
"""
Pull daily time series by stock ticker name.
Args: