简体   繁体   中英

Pandas Read csv just read a line of a row

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 df["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 a text file, 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 :)

试试这个: pd.DataFrame(dfname["columnname"])

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM