0

I am quite new to Numpy and Python.

Two different shapes for an input array, it's either

  • 24, 18, 2431
  • 9, 17, 2431

How can I convert to a Pandas data frame without using Panel (It's removed from Pandas 0.25.0). The output should look something like

index | A | B | C

0 | A_value | B_value | C_value

1 | A_value | B_value | C_value

2 | A_value | B_value | C_value

3 | A_value | B_value | C_value

4 | A_value | B_value | C_value
10
  • The question is: how do you want to convert this: should it stop when the first array stops (so 18 rows for the first one, 9 for the second), or some sort of way to resolve this? Commented Jul 27, 2019 at 14:28
  • 1
    possible duplicate of stackoverflow.com/questions/36235180/… Commented Jul 27, 2019 at 14:31
  • @WillemVanOnsem The thing is we can get different combinations so the idea is to have 24 x 18 x 2431 = 1,050,192 number of items in the data frame. Commented Jul 27, 2019 at 14:32
  • @VinayHegde Thanks so much for pointing this out. The answer used in the link your provided uses Panel which is removed in Pandas 0.25.0. Commented Jul 27, 2019 at 14:33
  • 1
    Is (A, B, C) supposed to be a shape? Because then your dataframe doesn't make sense, having dimension (sizes) as column header and values. Commented Jul 27, 2019 at 14:41

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.