BSON file to pandas dataframe

Viewed 3029

I'm looking to work on project involving the venmo dataset. I was able to torrent the bson file and it's sitting in my desktop, but I don't know what to do with it. I'm not too familar with MongoDB and i'm looking to turn it into a pandas dataframe for analysis. Anyone know any tips on doing so?

1 Answers

Find below an Python example how to read a bson file:

import pandas as pd
import bson

FILE="/folder/file.bson"

with open(FILE,'rb') as f:
    data = bson.decode_all(f.read())

main_df=pd.DataFrame(data)
main_df.describe()
Related