hello i want to convert one column to time and then plot it what i did is this
df = pd.read_csv('vv.txt',sep=" ",names=list(["time", "size", "type"]))
df.time = df.time.apply(lambda X: "{0:02.0f}:{1:02.0f}".format(*divmod(float(X) * 60, 60)))
df["time"] = pd.to_datetime(df["time"], format='%H:%M' ).apply(pd.Timestamp)
df["time"] = df["time"].map(lambda x: x.strftime("%H:%M"))
plt.scatter(df['time'], df['size'])
and it shows this as a result, no X-axis is showing right how can i solve this ?
source https://stackoverflow.com/questions/69781427/how-to-plot-a-time-after-conversion
Comments
Post a Comment