Skip to content

Instantly share code, notes, and snippets.

@sammatuba
sammatuba / splitPandasSeriesOfTuplesIntoPandasDataframe.py
Last active November 12, 2023 14:52
quickHow: how to split a column of tuples into a pandas dataframe
# Given a pandas dataframe containing a pandas series/column of tuples B,
# we want to extract B into B1 and B2 and assign them into separate pandas series
# Method 1: (faster)
# use pd.Series.tolist() method to return a list of tuples
# use pd.DataFrame on the resulting list to turn it into a new pd.DataFrame object, while specifying the original df index
# add to the original df
import pandas as pd
import time
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sammatuba
sammatuba / gitCheatsheet.md
Last active July 4, 2019 17:30
git cheatsheets

how to push a local drafts branch to local master branch and remote master branch

git checkout drafts
git branch --set-upstream-to master

git push . HEAD:master