python - How to *not* display 'NaN' in ipython notebook (html table of pandas dataframe)? -


i have small csv file of real-world data tests performed on different days, etc. not of same parameters tested in each session, there bunch of blank cells sprinkled around original spreadsheet.

tuner location,200,210,220,230,240,250,260,270,280 07/17 #1,,,0.319,0.319,0.233,,0.215,,0.3355 07/21 #1,,0.539,0.482,0.034,0.343,0.478,0.285,0.01,0.538 07/21 #2,,,0.107,0.407,0.559,,0.185,0.439,0.36 07/21 #3,,,0.127,,,,,, 07/22 #1,0.316,0.201,0.646,,,,,, 07/22 #2,,0.098,0.138,0.134,0.194,,,, 07/22 #3,,0.216,0.187,,,,,, 07/27 #1,,0.118,0.065,0.013,1.013,,,, 08/05 #1,,,,,,,0.032,, 08/05 #2,,,,,,,0.128,, 08/05 #3,,,,,,0.235,0.159,0.324, 08/05 #4,,,,,,,0.398,, 08/05 #5,,,,,,0.214,0.121,0.121, 

i'm trying learn manipulate , display data in ipython notebook in regular spreadsheet program. when run following lines inside notebook:

import pandas pd  # set print option dataframe represented html instead of plain text pd.core.format.set_printoptions(notebook_repr_html=true)  # read in csv file pandas dataframe df = pd.read_csv('tuner-data.csv')  # view html representation df 

i nice looking html table of data... 'nan' everywhere there blank cell in original csv file.

i understand 'why' nan necessary later calculations, makes table hard viewers read (my opinion).

is there good/easy/simple way suppress display of 'nan' in html table displayed in ipython notebook?

this page has suggestions. example, might try:

df.fillna(0) 

or:

df.fillna("") 

Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -