问题
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:
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()
来源:https://stackoverflow.com/questions/58474479/bson-file-to-pandas-dataframe