Formatting mongodb query to create pandas DataFrame from nodechef – issue with character limit

Home / python / Formatting mongodb query to create pandas DataFrame from nodechef – issue with character limit

Question:
I’m trying to import data from nodechef using MongoClient. I have been able to download a table for each specific collection using the following code:
from pymongo import MongoClient
import pandas as pd
client = MongoClient("mongodb://xxxx.nodechef.com:xxx")
db = client.xxxx
users= pd.DataFrame(list(db[‘collection’].find()))
However, in the dataframe that is returned, there appears to be a 50 character limit for the string variables so that they are not being returned in full.
{’email’: ”, ‘question1’: 1991, ‘question3′: …
{’email’: ‘x’, ‘question1’: 1980, ‘question3’:…
Each case for this variable in the dataframe is cut short. I’ve tried to find out how to extend this or remove potential character limits though have not been successful.

I think this might be to do with the .find() method and parameters within it though I’m fairly new to computer coding and don’t understand which parameter or how it would need changing (or it’s something else entirely!).

Thanks


Answer:

Read more

Leave a Reply

Your email address will not be published. Required fields are marked *