0

I try to show all value from a dataframe column with this code combinaison_df['coalesce'].unique()

but I got this result :

array([1.12440191, 0.54054054, 0.67510549, ..., 1.011378  , 1.39026812,
       1.99637024])

I need to see all the values. Do you have an idea to do?

Thanks

vizeetor
  • 41
  • 5
  • 1
    If it's a long set of values like this appears to be, there really isn't much you can do just by calling `.unique()`. You can update Pandas display options, but if there are a ton of values it might not be practical. Your best/easiest bet is to iterate over the unique values and print them to the console. – whege May 18 '22 at 16:08
  • You also have the option of dumping the unique values to a file using `np.savetxt` – Mortz May 18 '22 at 16:12
  • Does this answer your question? [Pandas: Setting no. of max rows](https://stackoverflow.com/questions/16424493/pandas-setting-no-of-max-rows) – deponovo May 18 '22 at 16:30

1 Answers1

-1

If I have this situation but don't want to change it for every print() statement I found this solution with a context manager quite handy:

with pd.option_context('display.max_rows', None):
    print(combinaison_df['coalesce'].unique())
Rabinzel
  • 7,757
  • 3
  • 10
  • 30