user1515250
user1515250

Reputation: 85

Plotting millisecond range in pandas

I am trying to create a plot waith an x range of e.g. 500 milliseconds.

rng = date_range(s,periods=500,freq="U")
df = DataFrame(randn(500),index=rng,columns=["A"])

to plot column A:

df["A"].plot()

The whole plot will be squeezed into a single spike because the x range is defined from Jan-2011 until Jul-2014.

Is there a way to change this?

Upvotes: 2

Views: 1730

Answers (1)

Chang She
Chang She

Reputation: 16970

I made a github issue regarding your problem: https://github.com/pydata/pandas/issues/1599 Please check back next week for a bug-fix release of pandas.

Also, the offset alias for millisecond frequency in pandas is 'L'. 'U' is the microsecond frequency alias.

Upvotes: 3

Related Questions