0

I am trying to get a single column from 4 separate pickle files and join them together.

1.pkl column "1"
2.pkl column "1"
3.pkl column "1"
4.pkl column "1"

I need a function that opens all files and extracts 1 column from all and combine them. I just can't figure out if it is in a list / series/ array which is making it difficult to write functions.

martineau
  • 119,623
  • 25
  • 170
  • 301
AMeng
  • 35
  • 3
  • If you unpickle a file and then call `print()` on what you get, you will be closer to knowing what sort of data structure you are dealing with. – BoarGules Jul 19 '21 at 18:13
  • You can also use a series of `try`/`except` blocks until one works. Look up "EAFP" and/or see [this](https://stackoverflow.com/questions/3733992/determine-whether-a-key-is-present-in-a-dictionary/3734681#3734681) answer of mine on the topic. – martineau Jul 19 '21 at 18:26

0 Answers0