Skip to content

Tag: dataframe

Change title font size in Plotly

I’m trying to update the title font size on my plot using the Plotly library, but it doesn’t works. This is how I defined my layout: It correctly set the the title and the shapes, but not the font size. Answer I think you can set the title font size using a dictionary:

Pandas Average of row ignoring 0

I have a DataFrame that looks like this: I need to find the mean of each row, ignoring instances of 0. My initial plan was to replace 0 with NaN and then get the mean excluding NaN. I tried to replace 0 with NaN, however this didn’t work, and the DataFrame still contained 0. I tried: The second issue is