Home > Mobile >  How do i remove dots at the end of Row data in Pandas dataframe
How do i remove dots at the end of Row data in Pandas dataframe

Time:05-08

when ever i am trying to get any data from a Pandas Dataframe,using the index, it is giving me data with dots at the end, the data is long but the output is coming with dots at the end.

                                              0

1 fsfsfsf | [email protected] | o&9na STLZp&TE 0 2 r25t4e ukiki | [email protected] | z96FIt H43... 0 3 juikyu7otjurfyh | [email protected] | NtOb%z0... 0 4 dqadd | [email protected] | adadada 0 5 rfw3tgegtegt | [email protected] | 27K(qfkm5)... 0 6 wwwr | [email protected] | cfbZih&)0X&i91 0 7 eewftg | [email protected] | XV8#huq9K%Z2#Jd8R 0 8 rerer | [email protected] | 8i9vi!(sf!BAf57Fi 0 9 dadadad | [email protected] | dadadada 0 10 Amazon | [email protected] | iS3FSy)Lu 3c%hY

CodePudding user response:

To remote trailing dots, we can use str.rstrip:

df["your_col"] = df["your_col"].str.rstrip('.')

CodePudding user response:

Data

1 fsfsfsf [email protected] o&9na STLZp&TE
2 r25t4e ukiki [email protected] z96FIt H43...
3 juikyu7otjurfyh [email protected] NtOb%z0...
4 dqadd [email protected] adadada
5 rfw3tgegtegt [email protected] 27K(qfkm5)...
6 wwwr [email protected] cfbZih&)0X&i91
7 eewftg [email protected] XV8#huq9K%Z2#Jd8R
8 rerer [email protected] 8i9vi!(sf!BAf57Fi
9 dadadad [email protected] dadadada
10 Amazon [email protected] iS3FSy)Lu 3c%hY

Explain

The ... is not a bug for output, it is just display optimization.

For example.

Df({"a":["0"*80]})

You will see

                                                   a
0  0000000000000000000000000000000000000000000000...

Answer

If you want to check what the data exactly, try df.to_csv or other method.

  • Related