Home > Enterprise >  Pandas Read csv just read a line of a row
Pandas Read csv just read a line of a row

Time:06-19

I have a classic panda data frame made of ID and Text. I would like to get just one column and therefore i use the typical dfname.["columnname"]. But at this point it becomes a Pandas Series. Is there a way to make a new dataframe with just that single column? I'm asking this is because if I cast the Pandas series in a string (columnname = columnname.astype ("string")) and I save it in txt I see that it only saves the first sentence of each line and not the entire textual content, as I would like.

If there are any other solution i'm open to learn :)

CodePudding user response:

It probably does read the whole thing but doesn't print it. try writing it in a file or print the cell just to be sure. BTW: You should add try adding your code for us to check if there is something wrong in it.

CodePudding user response:

Try this: pd.DataFrame(dfname["columnname"])

  • Related