Input to a three dimensional array in python
<p>I'm new at coding in python and I was wondering if there is some way I can transcript this code in C to python:</p>

<pre><code>for (K=1; K&lt;3; K++)
    for (I=0; I&lt;3; I++)
        for (J=0; J&lt;7; J++){
            printf("Year: %d\tProvince: %d\tMonth: %d: ", K, I, J);
            scanf("%f", &amp;A[I][J][K]);
        }
</code></pre>

<p>This is all I have done so far, the only thing missing is how to input data in the three dimensional array</p>

<pre><code>for k in range(1,3):
    for i in range(1,3):
        for j in range(1,7):
            print("Year: " + str(k) + " Province: " + str(i) + " Month: " + str(j) + ": ")
</code></pre>

<p>you could use numpy. example assuming you want float64s. change types add needed </p>

<pre><code>import numpy as np

arr = np.empty([2, 2, 6], np.float64)
for k in range(2):
    for i in range(2):
        for j in range(6):
            print("Year: " + str(k) + " Province: " + str(i) + " Month: " + str(j) + ": ")
            arr[k][i][j] = np.float64(raw_input())
</code></pre>

python c arrays input