dcgan.py: `df.plot(x=np.array([1, 101, 201]))` doesn't work
See original GitHub issueLine https://github.com/pytorch/ignite/blob/master/examples/gan/dcgan.py#L393 fails with an error,saying that nothing in Int64Index([1, 101, 201])
is in df.columns
(or something like that). To fix it, set index of the dataframe instead of passing x
argument.
Replace this:
df = pd.read_csv(os.path.join(output_dir, LOGS_FNAME), delimiter='\t')
x = np.arange(1, engine.state.iteration + 1, PRINT_FREQ)
_ = df.plot(x=x, subplots=True, figsize=(20, 20))
with this
df = pd.read_csv(os.path.join(output_dir, LOGS_FNAME), delimiter='\t') \
.set_index(np.arange(1, engine.state.iteration + 1, PRINT_FREQ))
_ = df.plot(subplots=True, figsize=(20, 20))
My python version is 3.7, pandas is 0.24.2.
Issue Analytics
- State:
- Created 4 years ago
- Comments:8
Top Results From Across the Web
pandas.DataFrame.plot showing colormap inconsistently
It actually seems to be related to pandas (scatter) plot and as you've pointed out to dtype float - some more details at...
Read more >Chart visualization — pandas 1.5.2 documentation - PyData |
Basic plotting: plot #. We will demonstrate the basics, see the cookbook for some advanced strategies. The plot method on Series and DataFrame...
Read more >Shaping and reshaping NumPy and pandas objects to avoid ...
Let's make a NumPy array from our DataFrame and check its shape. The shape returned matches what we saw when we used pandas....
Read more >Plot With Pandas: Python Data Visualization for Beginners
plot () returns a line graph containing data from every row in the DataFrame. The x-axis values represent the rank of each institution,...
Read more >How to Fix: Length of values does not match length of index
This tutorial explains how to fix the following error in Python: ... assign a NumPy array of values to a new column in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@vfdev-5 Not really. Overhead of doing
git clone
, setting up remote repositories, applying patch there, pushing, creating a PR - it’s too much.@vfdev-5 Yes, that sounds better. Just to be clear, I don’t want to do be the person responsible for implementing that change.