回答編集履歴
1
d
    
        answer	
    CHANGED
    
    | 
         @@ -3,6 +3,7 @@ 
     | 
|
| 
       3 
3 
     | 
    
         | 
| 
       4 
4 
     | 
    
         
             
            ```pythonimport numpy as np
         
     | 
| 
       5 
5 
     | 
    
         
             
            import matplotlib.pyplot as plt
         
     | 
| 
      
 6 
     | 
    
         
            +
            import numpy as np
         
     | 
| 
       6 
7 
     | 
    
         | 
| 
       7 
8 
     | 
    
         
             
            x = np.arange(30)
         
     | 
| 
       8 
9 
     | 
    
         
             
            y1 = 1**x
         
     | 
| 
         @@ -10,8 +11,8 @@ 
     | 
|
| 
       10 
11 
     | 
    
         
             
            s1 = np.cumsum(y1)
         
     | 
| 
       11 
12 
     | 
    
         
             
            s2 = np.cumsum(y2)
         
     | 
| 
       12 
13 
     | 
    
         | 
| 
       13 
     | 
    
         
            -
            plt.plot(x, s1, 'bo 
     | 
| 
      
 14 
     | 
    
         
            +
            plt.plot(x, s1, 'bo', label='$1^x$', ms=3)
         
     | 
| 
       14 
     | 
    
         
            -
            plt.plot(x, s2, 'go 
     | 
| 
      
 15 
     | 
    
         
            +
            plt.plot(x, s2, 'go', label='$(-1)^x$', ms=3)
         
     | 
| 
       15 
16 
     | 
    
         
             
            plt.xlabel('x')
         
     | 
| 
       16 
17 
     | 
    
         
             
            plt.ylabel('y')
         
     | 
| 
       17 
18 
     | 
    
         
             
            plt.title('series')
         
     |