May-11-2020, 03:19 PM
In pandas, is it possible to specify a range in head? for example say I want to view rows 10-20, is there something where I can do...
.head(10-20)
.head(10-20)
Pandas: .(head) Can I specify a range in head?
|
May-11-2020, 03:19 PM
In pandas, is it possible to specify a range in head? for example say I want to view rows 10-20, is there something where I can do...
.head(10-20)
May-11-2020, 03:28 PM
print(df.iloc[10:21])of course, don't forget index start at 0
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link Create MCV example Debug small programs
May-11-2020, 03:54 PM
this is what i have now...
sf.toPandas().head(20) can you please help format what I should have? Thank you
post minimal reproducible example. I don't know what
sf is? Probably sf.toPandas().iloc[10:21] df common name for pandas.DataFrame
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link Create MCV example Debug small programs
May-11-2020, 04:11 PM
sorry about that. SF is the name of my data frame...its coming from pyspark and then I am moving the data in to pandas.
sf.toPandas().head(20) Do you know who I would modify this line? Currently its giving me 20 rows but I would like to do within a range. thank you
May-11-2020, 04:26 PM
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link Create MCV example Debug small programs |
|
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
numpy.array has no attribute head | Led_Zeppelin | 1 | 1,490 |
Jul-13-2022, 12:56 AM Last Post: Led_Zeppelin |
|
Cannot get output for df.head() | Led_Zeppelin | 0 | 1,169 |
Jun-28-2022, 02:15 PM Last Post: Led_Zeppelin |
|
matplotlib x axis range goes over the set range | Pedroski55 | 5 | 3,467 |
Nov-21-2021, 08:40 AM Last Post: paul18fr |
|
Pyhton code help from head first with python | Shaikat_99 | 3 | 3,362 |
Jun-07-2020, 09:12 AM Last Post: snippsat |
|
Define a range, return all numbers of range that are NOT in csv data | KiNeMs | 18 | 7,529 |
Jan-24-2020, 06:19 AM Last Post: KiNeMs |
|
Cant get my head round the algorithm | hshivaraj | 1 | 2,460 |
Apr-09-2019, 10:38 PM Last Post: Yoriz |
|
invalid syntax in my program, really doing my head in! | Fazz92 | 1 | 4,077 |
May-07-2017, 12:54 PM Last Post: Bass |