Here you have the very quickest way. Using the insert_many
method from pymongo 3 and ‘records’ parameter of to_dict
method.
db.collection.insert_many(df.to_dict('records'))
More Related Contents:
- How to import data from mongodb to pandas?
- “Large data” workflows using pandas [closed]
- How to sort a dataFrame in python pandas by two or more columns?
- How to display pandas DataFrame of floats using a format string for columns?
- Why isn’t my Pandas ‘apply’ function referencing multiple columns working? [closed]
- Reading an Excel file in python using pandas
- Check if a string in a Pandas DataFrame column is in a list of strings
- Naturally sorting Pandas DataFrame
- Convert timedelta64[ns] column to seconds in Python Pandas DataFrame
- converting currency with $ to numbers in Python pandas
- How to normalize json correctly by Python Pandas
- search by ObjectId in mongodb with pymongo
- Use Multiple Character Delimiter in Python Pandas read_csv
- Merging dataframes based on date range
- Authenticate After Picking the Database
- Fast or Bulk Upsert in pymongo
- pandas: replace string with another string
- How to Ignore Duplicate Key Errors Safely Using insert_many
- how to merge two data frames based on particular column in pandas python?
- Getting Spark, Python, and MongoDB to work together
- How to convert a pymongo.cursor.Cursor into a dict?
- How to solve import error for pandas?
- Using .sort with PyMongo
- pandas, melt, unmelt preserve index
- Parse a Pandas column to Datetime when importing table from SQL database and filtering rows by date
- Python Pandas – Read csv file containing multiple tables
- Group DataFrame in 5-minute intervals
- Python Pandas add column for row-wise max value of selected columns [duplicate]
- Python Pandas: remove entries based on the number of occurrences
- ImportError: No module named objectid