Matplotlib plot is a no-show

后端 未结 3 1935
广开言路
广开言路 2020-12-13 08:45

When I run this code

import pandas as pd
import numpy as np
def add_prop(group):
    births = group.births.astype(float)
    group[\'prop\'] = births/births.         


        
相关标签:
3条回答
  • 2020-12-13 08:54

    your code is correct. just put:

    import matplotlib as plt
    

    for diplaying you plot:

    plt.show()
    
    0 讨论(0)
  • 2020-12-13 08:59

    Put

    import matplotlib.pyplot as plt
    

    at the top, and

    plt.show()
    

    at the end.

    0 讨论(0)
  • 2020-12-13 09:01

    In the IPython notebook you could also use %matplotlib inline at the top of the notebook to automatically display the created plots in the output cells.

    0 讨论(0)
提交回复
热议问题