-1

I want to reshape b into a tabular form

Where I have loaded the data using the following command since directly using pandas it gives me garbage values.

with open("xyz.txt", "rb") as fp:
    b = pickle.load(fp)

Printing the b I am getting the following output as a list

[ 0 1 2 3 4 5 6 7 \ 0 0.398039 0.407843 0.409804 0.509804 0.6 0.562745 0.547059 0.55098 8 9 ... 50166 50167 50168 50169 50170 \ 0 0.584314 0.582353 ... -0.003922 0.007843 0.001961 0.0 -0.001961 50171 50172 50173 50174 50175 0 0.0 0.0 -0.001961 -0.001961 0.001961 [1 rows x 50176 columns],

0 1 2 3 4 5 6 7 \ 0 0.003922 0.0 0.005882 0.001961 0.0 0.019608 0.052941 0.058824 8 9 ... 50166 50167 50168 50169 50170 \ 0 0.101961 0.141176 ... 0.003922 0.037255 -0.003922 -0.027451 0.001961 50171 50172 50173 50174 50175 0 0.005882 -0.013725 0.029412 -0.007843 0.003922 [1 rows x 50176 columns]]

**

I want to get the following data in the following way.
    Index    Values

        0        0
        1        0.398039
        2        0.407843
        3        0.509804

**

piash tanjin
  • 108
  • 2
  • 7
  • 5
    Welcome to StackOverflow. Please take the time to read this post on [how to provide a great pandas example](https://stackoverflow.com/questions/20109391/how-to-make-good-reproducible-pandas-examples) as well as how to provide a [minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve) and revise your question accordingly. These tips on how to ask a good question may also be useful. – yatu Apr 04 '20 at 17:36
  • 3
    why not directly read using pandas? also [please dont post images of dataframe , refer comment above](https://meta.stackoverflow.com/questions/285551/why-not-upload-images-of-code-on-so-when-asking-a-question) – anky Apr 04 '20 at 17:37
  • Since I don't have 10 reputations I am unable to upload images kindly visite the link. – piash tanjin Apr 04 '20 at 17:41
  • 2
    Please read the guide. You should be posting samples of your dataframe so we can reproduce the problem – yatu Apr 04 '20 at 17:42
  • Since I am unable to directly read using pandas because it gives me garbage values. – piash tanjin Apr 04 '20 at 17:43
  • "Garbage in, garbage out". You probably use it wrongly. Provide some more detail on your code so that we can help you more accurately. – s.k Apr 04 '20 at 17:50

0 Answers0