0

I wanna create sub dataframes from a main one My main dataframe will look more or less like this one enter image description here I wanna be able to have as a sub-dataframe like the following :

first sub dataframe second sub dataframe

and all the rest for example in an another frame. My goal is to transform correctly my big dataframe into sub dataframe.

Any help will be appreciated, thanks :-)

ImRi
  • 1
  • 1
  • 1
    [Please don't post images of code (or links to them)](http://meta.stackoverflow.com/questions/285551/why-may-i-not-upload-images-of-code-on-so-when-asking-a-question) – jezrael Feb 09 '18 at 11:22
  • 2
    Welcome to StackOverflow. Please take the time to read this post on [how to provide a great pandas example](http://stackoverflow.com/questions/20109391/how-to-make-good-reproducible-pandas-examples) as well as how to provide a [minimal, complete, and verifiable example](http://stackoverflow.com/help/mcve) and revise your question accordingly. These tips on [how to ask a good question](http://stackoverflow.com/help/how-to-ask) may also be useful. – jezrael Feb 09 '18 at 11:22
  • it wasn't really code but a view of a dataframe using pycharm. I thought it'd be more comprehensible to share a picture :-) – ImRi Feb 09 '18 at 12:29
  • And thank you for your advice – ImRi Feb 09 '18 at 12:29

1 Answers1

0

You can take a rectangular section with numeric indices like this:

df.iloc[4:8, 0:8] # four rows, eight columns

Or you can use loc with column and row labels (but your data seem to be numerically labeled).

John Zwinck
  • 239,568
  • 38
  • 324
  • 436