Pandas notes

From DiLab
Revision as of 12:29, 25 October 2017 by Leo (talk | contribs) (→Plot options)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Using Python Pandas package for data analysis. Leo's notes.

Plot options

Define the colors of the plot data

df.plot(color="rgbk")

Different plot types (markers)

df.plot(marker='.')

Limit the X axis values:

df.plot(xlim=(0,4000))

Naming the axis

ax = df.plot()
ax.set_ylabel(AntNames[x])

Placement of the legend (Below-left of the plot)

df.plot().legend(loc='upper left', bbox_to_anchor=(0, 0))

Removing the legend

ax = df.plot()
ax.legend_.remove()