86d4c5df21db07ab75e7eac9ed36d2799b4bf440,research/src/fetch_campaign_donations.py,Donation,data,#Donation#,90
Before Change
committees
files = self.FILENAMES.get(year)
if not files: // it"s 2010, a different file architecture
return {
"candidates": self._data_by_pattern("Receitas", "candidato"),
"parties": self._data_by_pattern("Receitas", "partido"),
"committees": self._data_by_pattern("Receitas", "comite")
}
paths = (os.path.join(self.directory, filename) for filename in files)
keys = ("candidates", "parties", "committees")
return {
key: self._read_csv(path, chunksize=10000)
After Change
data = self._data()
for key in KEYS:
normalize_columns = self.NORMALIZE_COLUMNS.get(key)
if key in data:
// strip columns names ("foobar " -> "foobar")
names = data[key].columns.values
cleaned_columns = {name: name.strip() for name in names}
data[key].rename(columns=cleaned_columns, inplace=True)
// normalize & translate
data[key].rename(columns=normalize_columns, inplace=True)
data[key].rename(columns=TRANSLATIONS, inplace=True)
return data
def __enter__(self):
self._download()
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: okfn-brasil/serenata-de-amor
Commit Name: 86d4c5df21db07ab75e7eac9ed36d2799b4bf440
Time: 2017-11-19
Author: cuducos@users.noreply.github.com
File Name: research/src/fetch_campaign_donations.py
Class Name: Donation
Method Name: data
Project Name: QUANTAXIS/QUANTAXIS
Commit Name: 5dd65b017cf87fa4d88c5123d4b3385d4591a2a0
Time: 2019-03-13
Author: namedhard@zeroun.net
File Name: QUANTAXIS/QAMarket/QATTSBroker.py
Class Name: QA_TTSBroker
Method Name: data_to_df
Project Name: has2k1/plotnine
Commit Name: 3c23a55f84ab81bf825f266bab38b5bd6cbd09b1
Time: 2018-07-31
Author: has2k1@gmail.com
File Name: plotnine/facets/facet_wrap.py
Class Name: facet_wrap
Method Name: compute_layout