Title: How to export DataFrame to csv without index using rpy2?
Tags: python;r;csv;rpy2
Question: How to remove csv indexing when saving a dataframe using rpy2? Below is how it is done in R, and my attempt python:
R code:
write.csv(dataframe, save_path, row.names = FALSE)
Python code:
from rpy2.robjects.packages import importr
utils_package = importr("utils")  # import utils package from R
utils_package.write_csv(dataframe, save_path)  # what to add to remove the row names(i.e., index)?

Here is the accepted answer: In R, write.csv() is actually a wrapper for the more general write.table() function where former has arguments pre-set such as comma separator. Consider using the the more general function in Python specifying the row_names -of course still with comma separator. Below includes a few alternatives:
# USING WRITE.TABLE()
utils_package.write_table(xmldf, save_path, sep=",", row_names=False)
# INCLUDING NON-DEFAULT ARGUMENTS
utils_package.write_table(x=xmldf, file=save_path, sep=",", row_names=False)
# INCLUDING ALL ARGUMENTS
utils_package.write_table(xmldf, save_path, False, True, ",", "\r", "NA", ".", False)
Alternatively, the ro.r() object can be used without needing to import base packages:
import rpy2.robjects as ro
output = ro.r['write.table'](x=xmldf, file=save_path, sep=",", row_names=False)

Here is another answer: row_names=True work... if the named parameter was explicitly defined in the signature for the function in the R code. Unfortunately it is fetched from the ellipsis ....
**{'row.names': True} should work.
More in the documentation: http://rpy2.readthedocs.org/en/version_2.7.x/robjects_rpackages.html
Note: you also try the dynamically-generated docstring (?utils_package.write_csv in ipython).
Comment for this answer: utils_package.write_csv(dataframe, save_path, row_names=False) does not work @Igautier. Is this what you meant? I get the error: "unused argument (row_names = FALSE)"

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 2, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2016:00:02/24/16', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<python><r><csv><rpy2>', 'Title': 'How to export DataFrame to csv without index using rpy2?', 'ViewCount': 943, 'id': 35609364, 'user_AboutMe': '', 'user_AccountId': 2863065.0, 'user_DisplayName': 'gcamargo', 'user_Reputation': 3217.0, 'user_Views': 202.0, 'user_id': 2457899.0}}