Pandas read_csv not reading all rows?Pandas cannot load data, csv encoding mysteryHow to upgrade all Python packages with pip?How do I list all files of a directory?How to read a file line-by-line into a list?Add one row to pandas DataFrameRenaming columns in pandasDelete column from pandas DataFrame by column namePandas read_csv and UTF-16“Large data” work flows using pandasHow to iterate over rows in a DataFrame in Pandas?Select rows from a DataFrame based on values in a column in pandas

Are there any symmetric cryptosystems based on computational complexity assumptions?

Can more than one instance of Bend Luck be applied to the same roll by multiple Wild Magic sorcerers?

Windows reverting changes made by Linux to FAT32 partion

Have the writers and actors of GOT responded to its poor reception?

Can I get the output of a command line program with TeX (using e.g. read18)?

Why does the U.S military use mercenaries?

How to pipe results multiple results into a command?

Can ThermodynamicData be used with NSolve?

Why would company (decision makers) wait for someone to retire, rather than lay them off, when their role is no longer needed?

Would a "ring language" be possible?

Physically unpleasant work environment

How do you cope with rejection?

How would fantasy dwarves exist, realistically?

What do you call bracelets you wear around the legs?

Why wear sunglasses in indoor velodromes?

on the truth quest vs in the quest for truth

In Dutch history two people are referred to as "William III"; are there any more cases where this happens?

Why is so much ransomware breakable?

What should I wear to go and sign an employment contract?

How do I balance a campaign consisting of four kobold PCs?

Told to apply for UK visa before other visas, on UK-Spain-etc. visit

Failing students when it might cause them economic ruin

How to laser-level close to a surface

Hotel booking: Why is Agoda much cheaper than booking.com?



Pandas read_csv not reading all rows?


Pandas cannot load data, csv encoding mysteryHow to upgrade all Python packages with pip?How do I list all files of a directory?How to read a file line-by-line into a list?Add one row to pandas DataFrameRenaming columns in pandasDelete column from pandas DataFrame by column namePandas read_csv and UTF-16“Large data” work flows using pandasHow to iterate over rows in a DataFrame in Pandas?Select rows from a DataFrame based on values in a column in pandas






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I have a text file containing 7 millions rows of text ~ and encoded in utf-16.



70357719 new.file

new.file: text/plain; charset=utf-16le


When I use pandas read_csv encoding to utf-16 it only imports a percentage of the rows.



Using the following test code;



import pandas as pd 
data = pd.read_csv('new.file',names=['Text'],sep="n")
print "Plain:",len(data)

data = pd.read_csv('new.file',names=['Text'],encoding="utf-16",sep="n")
print "utf-16",len(data)


Provides the following output;



'Plain:', 215585254
'utf-16', 65446415


I'm using python 2.7, and have already tested for empty rows in the file (of which there are none).



Basically, I'm at a lost for what to try next, I need all rows of this file to be imported.










share|improve this question






















  • Take a look: stackoverflow.com/questions/38728366/… and stackoverflow.com/questions/55316476/…

    – rafaelc
    Mar 23 at 17:52











  • Why are you using sep="n"?

    – Benitok
    Mar 23 at 17:53











  • RafaelC, the second links goes back to this question. | Benitok, to separate each line = row, I'm aware names= would also do this.

    – F.D
    Mar 23 at 17:56

















0















I have a text file containing 7 millions rows of text ~ and encoded in utf-16.



70357719 new.file

new.file: text/plain; charset=utf-16le


When I use pandas read_csv encoding to utf-16 it only imports a percentage of the rows.



Using the following test code;



import pandas as pd 
data = pd.read_csv('new.file',names=['Text'],sep="n")
print "Plain:",len(data)

data = pd.read_csv('new.file',names=['Text'],encoding="utf-16",sep="n")
print "utf-16",len(data)


Provides the following output;



'Plain:', 215585254
'utf-16', 65446415


I'm using python 2.7, and have already tested for empty rows in the file (of which there are none).



Basically, I'm at a lost for what to try next, I need all rows of this file to be imported.










share|improve this question






















  • Take a look: stackoverflow.com/questions/38728366/… and stackoverflow.com/questions/55316476/…

    – rafaelc
    Mar 23 at 17:52











  • Why are you using sep="n"?

    – Benitok
    Mar 23 at 17:53











  • RafaelC, the second links goes back to this question. | Benitok, to separate each line = row, I'm aware names= would also do this.

    – F.D
    Mar 23 at 17:56













0












0








0








I have a text file containing 7 millions rows of text ~ and encoded in utf-16.



70357719 new.file

new.file: text/plain; charset=utf-16le


When I use pandas read_csv encoding to utf-16 it only imports a percentage of the rows.



Using the following test code;



import pandas as pd 
data = pd.read_csv('new.file',names=['Text'],sep="n")
print "Plain:",len(data)

data = pd.read_csv('new.file',names=['Text'],encoding="utf-16",sep="n")
print "utf-16",len(data)


Provides the following output;



'Plain:', 215585254
'utf-16', 65446415


I'm using python 2.7, and have already tested for empty rows in the file (of which there are none).



Basically, I'm at a lost for what to try next, I need all rows of this file to be imported.










share|improve this question














I have a text file containing 7 millions rows of text ~ and encoded in utf-16.



70357719 new.file

new.file: text/plain; charset=utf-16le


When I use pandas read_csv encoding to utf-16 it only imports a percentage of the rows.



Using the following test code;



import pandas as pd 
data = pd.read_csv('new.file',names=['Text'],sep="n")
print "Plain:",len(data)

data = pd.read_csv('new.file',names=['Text'],encoding="utf-16",sep="n")
print "utf-16",len(data)


Provides the following output;



'Plain:', 215585254
'utf-16', 65446415


I'm using python 2.7, and have already tested for empty rows in the file (of which there are none).



Basically, I'm at a lost for what to try next, I need all rows of this file to be imported.







python pandas






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 23 at 17:28









F.DF.D

7411




7411












  • Take a look: stackoverflow.com/questions/38728366/… and stackoverflow.com/questions/55316476/…

    – rafaelc
    Mar 23 at 17:52











  • Why are you using sep="n"?

    – Benitok
    Mar 23 at 17:53











  • RafaelC, the second links goes back to this question. | Benitok, to separate each line = row, I'm aware names= would also do this.

    – F.D
    Mar 23 at 17:56

















  • Take a look: stackoverflow.com/questions/38728366/… and stackoverflow.com/questions/55316476/…

    – rafaelc
    Mar 23 at 17:52











  • Why are you using sep="n"?

    – Benitok
    Mar 23 at 17:53











  • RafaelC, the second links goes back to this question. | Benitok, to separate each line = row, I'm aware names= would also do this.

    – F.D
    Mar 23 at 17:56
















Take a look: stackoverflow.com/questions/38728366/… and stackoverflow.com/questions/55316476/…

– rafaelc
Mar 23 at 17:52





Take a look: stackoverflow.com/questions/38728366/… and stackoverflow.com/questions/55316476/…

– rafaelc
Mar 23 at 17:52













Why are you using sep="n"?

– Benitok
Mar 23 at 17:53





Why are you using sep="n"?

– Benitok
Mar 23 at 17:53













RafaelC, the second links goes back to this question. | Benitok, to separate each line = row, I'm aware names= would also do this.

– F.D
Mar 23 at 17:56





RafaelC, the second links goes back to this question. | Benitok, to separate each line = row, I'm aware names= would also do this.

– F.D
Mar 23 at 17:56












0






active

oldest

votes












Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55316476%2fpandas-read-csv-not-reading-all-rows%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55316476%2fpandas-read-csv-not-reading-all-rows%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript