How to write tweet IDs to a CSV file as strings

I have a column which contains a list of tweet IDs. A tweet ID could get as long as this '475685437424427008'. When I write this to a CSV file using the data.to_csv() method they get written as float. How do I retain the numbers as string?


Even after writing a list of strings (long int converted to string) to a csv file using dataframe, while reading the same file pandas reads the column as int 64. While reading a csv file into dataframe we can specify the format for particular column.

sample.csv file contains:


I'm running:

import pandas as pd
df = pd.read_csv('sample.csv', converters={'ID': str})


  • sample.csv is the file which has the column 'ID'
  • 'ID' column has the long int values.

Need Your Help

How to set file permissions (chmod) appropriately?

php file-permissions chmod

On an app I'm working on, when a user registers an account, the registration script is supposed to create two folders for the user. The user's personal folder within a preexisting folder called 'us...

Reading .csv data from URL in python: extra lines

python url csv codec

First post on stackoverflow, and a newbie to python. I'm trying to read weather data from a location from wunderground. It should be straightforward:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.