Last active
September 12, 2022 06:47
-
-
Save Abhayparashar31/71656bcbb0eab33b22b0cd9c178c7c02 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from zipfile import ZipFile | |
import pandas as pd | |
from pathlib import Path | |
def get_data(file): | |
if file is not None: | |
with ZipFile(file,"r") as zipobj: | |
zipobj.extractall("data") | |
for p in Path("./data").glob("*.csv"): | |
connections_csv = p.name | |
df = pd.read_csv(f'data/{connections_csv}',skiprows=3) ## skipping top 3 rows containing redundant data | |
return df | |
df = get_data('Basic_LinkedInDataExport_06-10-2022.zip')d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment