I have a simple question that I could not find anywhere the solution. I'm sorry if this is already asked here.
My code is simple:
s = pd.Series(np.random.rand(150))
I just want to print it and see all of its output:
print(s)
The output:
>>> print(s)
0 0.580686
1 0.508062
2 0.184946
3 0.275074
4 0.831654
5 0.080571
6 0.153813
7 0.088002
8 0.082935
9 0.513361
10 0.064965
11 0.325820
12 0.933384
13 0.605428
14 0.121554
15 0.767311
16 0.476030
17 0.423448
18 0.028080
19 0.905429
20 0.185212
21 0.770636
22 0.569428
23 0.294643
24 0.482404
25 0.217303
26 0.406958
27 0.893210
28 0.863044
29 0.270612
...
120 0.221621
121 0.077798
122 0.154689
123 0.155532
124 0.828792
125 0.564565
126 0.714583
127 0.913120
128 0.632600
129 0.115126
130 0.543111
131 0.420206
132 0.135349
133 0.912911
134 0.788410
135 0.685158
136 0.282509
137 0.545654
138 0.074851
139 0.247384
140 0.244246
141 0.798268
142 0.348548
143 0.775883
144 0.114062
145 0.246298
146 0.216241
147 0.639255
148 0.902388
149 0.416965
Length: 150, dtype: float64
As you can see it is dividing my output from line 29 to 120. I want the whole output to be written.
I've tried this in the Ubuntu terminal, IPython Console 6.5.0, both running as a saved file & running on the interactive shells.
Then, I wondered what if I wanted the output in a file:
import pandas as pd
import numpy as np
with open('test.txt', 'w') as myfile:
s = pd.Series(np.random.randn(150))
myfile.write(str(s))
.. I checked the test.txt
. Output is still the same, divided with '...'.
How can I make python to print all of the output?