Skip to content

Instantly share code, notes, and snippets.

import openpyxl
files = [] # Insert paths to files here
for file in files:
wb = openpyxl.load_workbook(file)
sheet = wb['Sheet1']
sheet['F9'] = '=SUM(F5:F8)'
sheet['F9'].style = 'Currency'
wb.save(file)
# Section 1
import openpyxl
files = [] #include paths to your files here
values = []
# Section 2
for file in files:
wb = openpyxl.load_workbook(file)
sheet = wb['Sheet1']
# Section 1
import pandas as pd
files = ['https://github.com/datagy/mediumdata/raw/master/january.xlsx', 'https://github.com/datagy/mediumdata/raw/master/february.xlsx', 'https://github.com/datagy/mediumdata/raw/master/march.xlsx']
combined = pd.DataFrame()
# Section 2
for file in files:
df = pd.read_excel(file, skiprows = 3)
combined = combined.append(df, ignore_index = True)
const duplicates = filesAndHashes.filter((file1, index1, array) => {
return array.some(
(file2, index2) => index1 !== index2 && file1.hash === file2.hash,
)
})
const groups = duplicates.reduce((groups, {filepath, hash}) => {
groups[hash] = groups[hash] || []
groups[hash].push(filepath)
return groups
@reinvanoyen
reinvanoyen / terminal-prompt-git-branch-zsh.md
Last active April 30, 2024 21:16
Add Git Branch Name to Terminal Prompt (MacOS zsh)

Add Git Branch Name to Terminal Prompt (zsh)

Updated for MacOS with zsh

  • Catalina
  • Big Sur
  • Monterey
  • Ventura
  • Sonoma

screenshot

@CodingDoug
CodingDoug / README.md
Last active May 6, 2021 14:35
Building an assistant (chatbot) that translates languages, integrated with Slack
@ffranr
ffranr / resources_for_learning_python.md
Created October 29, 2017 14:56
Resources For Learning Python

Resources For Learning Python

Links to free resources for learning Python. Please report (via comments) broken links or if a resource is no longer free.

Inspiration

Title Link Comments
Official Python Brochure Official Python Brochure - PDF
- Used by Google, Mozilla, NASA,
Finance (Two Sigma, JPM, BAML),
Animation (Blender)
Official Python Jobs Board - Jobs specifically targetted at Python developers
@bbengfort
bbengfort / sentiment.py
Last active December 27, 2022 05:17
An end-to-end demonstration of a Scikit-Learn SVM classifier trained on the positive and negative movie reviews corpus in NLTK.
import os
import time
import string
import pickle
from operator import itemgetter
from nltk.corpus import stopwords as sw
from nltk.corpus import wordnet as wn
from nltk import wordpunct_tokenize
@andrawaag
andrawaag / WIkidataMalariaCounts.R
Created December 7, 2015 14:54
Get a spatial map in R on Number of cases of Malaria in Wikidata added the SWAT4LS tutorial
library(SPARQL)
library(ggplot2)
library(rworldmap)
wdqs <- "https://query.wikidata.org/bigdata/namespace/wdq/sparql"
query <- "PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX v: <http://www.wikidata.org/prop/statement/>