0

I have a 4D NumPy array (Importer, product, demand sector, and exporter) of a land footprint of trade data. I want to create a Dataframe where each variable will have a one-to-one relationship with others and at the end, there will be a value column. Each row will contain information like Argentine export of wheat consumed by households in Germany creates X amount of Land footprint.

In: FP_fd_Merc[0,:,:,CountryNo,:].shape
Out: (28, 4, 200, 7)
akif
  • 1
  • 1
  • Can you post a sample of your numpy array? – XXavier Sep 12 '21 at 15:22
  • Please [do not post images](https://meta.stackoverflow.com/questions/285551/why-not-upload-images-of-code-errors-when-asking-a-question) of your data or errors. You can include [code that creates a dataframe such as `df.to_dict()` or the output of `print(df)`](https://stackoverflow.com/questions/20109391/how-to-make-good-reproducible-pandas-examples) (include at least the few rows and columns that allow to reproduce your issue) – Cimbali Sep 12 '21 at 15:45
  • @XXavier I have added the shape of the array, it contains float64 numbers – akif Sep 12 '21 at 16:52
  • Does this answer your question? [3 dimensional numpy array to multiindex pandas dataframe](https://stackoverflow.com/questions/43427189/3-dimensional-numpy-array-to-multiindex-pandas-dataframe) – Arne Sep 12 '21 at 21:07

0 Answers0