I want to include an input argument in a function which is not always necessary .how to do that? for example:
df=
0 75.713669 35.917743
1 75.556753 35.626998
2 75.296503 35.190880
3 75.124278 34.881007
4 75.047734 34.708855
def plot_df(Dataframe,color):
df=Dataframe
if color!= None:
a=df.plot()
else:
plt.plot(color=color)
plt.show()
I want to use this function sometimes with the intention of having a specific color in output plot
plot_df(DataFrame,color='red')
And sometimes I am not strict about the color factor in the plot
plot_df(DataFrame)
How to implement this in the function?