Browse Source

Last changed

master
Bianca Steffes 3 years ago
parent
commit
977b00d378
  1. 30
      pycharm/ExtractZippedData.py
  2. BIN
      pycharm/data.pkl
  3. BIN
      pycharm/download.zip

30
pycharm/ExtractZippedData.py

@ -0,0 +1,30 @@
import json
import os
import zipfile
from io import BytesIO
import pandas as pd
def addOneAthlete(df, file):
data = json.load(file)
df = df.append(data, ignore_index=True)
return df
def create_pcikle():
df = pd.DataFrame()
with zipfile.ZipFile('download.zip') as z:
for filename in z.namelist():
if filename.endswith('.zip'):
zfiledata = BytesIO(z.read(filename))
with zipfile.ZipFile(zfiledata) as zfile2:
for name2 in zfile2.namelist():
with zfile2.open(name2) as f:
df = addOneAthlete(df, f)
df.to_pickle('data.pkl')
if __name__ == '__main__':
data = pd.read_pickle('data.pkl')
print('x')

BIN
pycharm/data.pkl

BIN
pycharm/download.zip

Loading…
Cancel
Save