Skip to content

Instantly share code, notes, and snippets.

@rchardptrsn
rchardptrsn / combine files.py
Last active August 20, 2023 01:29
combine files.py
import glob as glob
import pandas as pd
#define path to CSV files
path = r'ndvi data/*.csv'
#identify all CSV files
all_files = glob.glob(path)
#merge all CSV files into one DataFrame
fireNDVI = pd.concat((pd.read_csv(f) for f in all_files), ignore_index=True)
@rchardptrsn
rchardptrsn / analyze NDVI.py
Created August 15, 2023 02:12
analyze NDVI
# Extract Year and Month
fireNDVI['Year'] = fireNDVI.Date.str.split(pat='-',expand=True)[0]
fireNDVI['Month'] = fireNDVI.Date.str.split(pat='-',expand=True)[1]
# filter to June, July, August
fireNDVI = fireNDVI[fireNDVI.Month.isin(['06','07','08'])]
# find average of 3 months for 2021 for object id
# then find average of 3 months for 2022 for object id
# subtract 2022-2021
@rchardptrsn
rchardptrsn / compose_sql_server.yaml
Last active August 2, 2025 13:13
Docker compose file for SQL Server 2022
services:
mssql:
container_name: mssql-db
hostname: mssql-db
image: mcr.microsoft.com/mssql/server:2022-latest
environment:
ACCEPT_EULA: 'Y'
MSSQL_SA_PASSWORD: 'Passw0rd'
MSSQL_DATA_DIR: /var/opt/mssql/data