Question

Dataframe (pandas) and their rows and columns As shown in the picture below, is there any way for us to split or obtain only a certain section of the DataFrame? For example, out of those dataframes, I want the 5th to 13th row and 26th to 69th column of data. mid: point mls at Unnamed: Unnamed: Unnamed: Unnamed: Unnamed: height height data Unnamed Unnamed- Unnamed: fred fraction bins Decimal Day Date & Time 53 00 Year 60 00 80 00 90 00 100 00 110 00 120 00 140 00 ignore ignore NaN NaN 12-1-18 0.00 8 11 8 21 8 24 8 28 8 29 8 34 NaN NaN NaN NaN 2010-12-01 0.10 335.00894 4.47 444 441 4.39 443 NaN NaN NaN NaN 2018-12-01 0.20 335.01309 4.50 416 435 432 4.33 433 431 NaN NaN NaN NaN 2018-12-01 0.30 335.02083 4.33 427 423 420 420 NaN NaN NaN NaN 2018-12-26 10.00 3597 360.75 789 791 809 824 824 801 NaN NaN NaN NaN NaN 3698 360.77778 2018-12-26 18:40 8.00 820 837 846 854 NaN NaN NaN NaN NaN 2018-12-26 18:50 3599 380.78472 7.03 0.18 9.91 9.93 9.05 9.17 9.93 NaN NaN NaN NaN NaN 3600 350.8125 2018-12-26 13:30 7.14 7.28 7.78 7.85 7.91 7.96 NaN NaN NaN NaN NaN 2018-12-26 22:20 3601 360.93056 5.81 7.79 NaN NaN NaN NaN NaN mid_point unnamed: Unnamed: Unnamed: Unnamed: Unnamed: 100 height height data unnamed: Unnamed: freq fraction bins Decimal Day Date & Time Year 53.00 60.00 80.00 90.00 102.00 110.00 120.00 140.00 ignore ignore NaN NaN 12-1-18 0.00 335 0.11 0.12 0.21 0.24 0.26 0.27 0.29 0.34 NaN NaN NaN NaN 335.00694 2018-12-01 0.10 4.49 4.41 4.39 459 NaN NaN NaN NaN 335.01389 2018-12-01 0.20 432 433 431 NaN NaN NaN NaN 335.02093 2018-12-01 0.30 433 427 423 420 420 NaN NaN NaN NaN 2010-12-26 18:00 3597 360.75 9.12 7.89 7.91 0.09 0.24 0.24 0.01 NaN NaN NaN NaN NaN 3598 360.77778 2018-12-26 18:40 8.28 8.20 8.37 8.46 8.54 8.23 NaN NaN NaN NaN NaN 2018-12-26 19:50 3599 360.78472 7.03 8.91 8.93 9.05 9.17 NaN NaN NaN NaN NaN 3800 380.8125 2018-12-26 19:30 7.14 7.478 7.91 96 791 NaN NaN NaN NaN NaN 2010-12-26 22:20 3601 3680.93058 5.91 6.40 7.52 7.79 7.84 7.84 NaN NaN NaN NaN NaN 440

          Dataframe (pandas) and their rows and columns

As shown in the picture below, is there any way for us to split or obtain only a certain section of the DataFrame? For example, out of those dataframes, I want the 5th to 13th row and 26th to 69th column of data.

mid: point
mls at Unnamed: Unnamed: Unnamed: Unnamed: Unnamed: height height data
Unnamed
Unnamed- Unnamed: fred fraction
bins
Decimal Day Date & Time 53 00 Year
60 00
80 00
90 00 100 00 110 00 120 00
140 00
ignore
ignore
NaN
NaN
12-1-18 0.00
8 11
8 21
8 24
8 28
8 29
8 34
NaN
NaN
NaN
NaN
2010-12-01 0.10
335.00894
4.47
444
441
4.39
443
NaN
NaN
NaN
NaN
2018-12-01 0.20
335.01309
4.50
416
435
432
4.33
433
431
NaN
NaN
NaN
NaN
2018-12-01 0.30
335.02083
4.33
427
423
420
420
NaN
NaN
NaN
NaN
2018-12-26 10.00
3597
360.75
789
791
809
824
824
801
NaN
NaN
NaN
NaN
NaN
3698
360.77778
2018-12-26 18:40
8.00
820
837
846
854
NaN NaN
NaN
NaN
NaN
2018-12-26 18:50
3599
380.78472
7.03
0.18
9.91
9.93
9.05
9.17
9.93
NaN NaN
NaN
NaN
NaN
3600
350.8125
2018-12-26 13:30
7.14
7.28
7.78
7.85
7.91
7.96
NaN NaN
NaN
NaN
NaN
2018-12-26 22:20
3601
360.93056
5.81
7.79
NaN NaN
NaN
NaN
NaN
mid_point
unnamed:
Unnamed:
Unnamed: Unnamed: Unnamed: 100 height height data
unnamed:
Unnamed: freq fraction
bins
Decimal Day Date & Time Year
53.00
60.00
80.00
90.00 102.00 110.00 120.00
140.00
ignore
ignore
NaN
NaN
12-1-18 0.00
335
0.11
0.12
0.21
0.24
0.26
0.27
0.29
0.34
NaN
NaN
NaN
NaN
335.00694
2018-12-01 0.10
4.49
4.41
4.39
459
NaN
NaN
NaN
NaN
335.01389
2018-12-01 0.20
432
433
431
NaN
NaN
NaN
NaN
335.02093
2018-12-01 0.30
433
427
423
420
420
NaN
NaN
NaN
NaN
2010-12-26 18:00
3597
360.75
9.12
7.89
7.91
0.09
0.24
0.24
0.01
NaN NaN
NaN
NaN
NaN
3598
360.77778
2018-12-26 18:40
8.28
8.20
8.37
8.46
8.54
8.23
NaN NaN
NaN
NaN
NaN
2018-12-26 19:50
3599
360.78472
7.03
8.91
8.93
9.05
9.17
NaN NaN
NaN
NaN
NaN
3800
380.8125
2018-12-26 19:30
7.14
7.478
7.91
96
791
NaN
NaN
NaN
NaN
NaN
2010-12-26 22:20
3601
3680.93058
5.91
6.40
7.52
7.79
7.84
7.84
NaN NaN
NaN
NaN
NaN
440
        
Show more…
question on python computer language dataframe pandas and their rows and columns as shown by the below picture is there any way for us to split or obtain only the certain section of the data 38988

Added by Stephen T.

Close

Computer Science and Information Technology
Computer Science and Information Technology
Trishna Knowledge Systems 2018 Edition
AceChat toggle button
Close icon
Ace pointing down

Please give Ace some feedback

Your feedback will help us improve your experience

Thumb up icon Thumb down icon
Thanks for your feedback!
Profile picture
Dataframe (pandas) and their rows and columns As shown in the picture below, is there any way for us to split or obtain only a certain section of the DataFrame? For example, out of those dataframes, I want the 5th to 13th row and 26th to 69th column of data. mid: point mls at Unnamed: Unnamed: Unnamed: Unnamed: Unnamed: height height data Unnamed Unnamed- Unnamed: fred fraction bins Decimal Day Date & Time 53 00 Year 60 00 80 00 90 00 100 00 110 00 120 00 140 00 ignore ignore NaN NaN 12-1-18 0.00 8 11 8 21 8 24 8 28 8 29 8 34 NaN NaN NaN NaN 2010-12-01 0.10 335.00894 4.47 444 441 4.39 443 NaN NaN NaN NaN 2018-12-01 0.20 335.01309 4.50 416 435 432 4.33 433 431 NaN NaN NaN NaN 2018-12-01 0.30 335.02083 4.33 427 423 420 420 NaN NaN NaN NaN 2018-12-26 10.00 3597 360.75 789 791 809 824 824 801 NaN NaN NaN NaN NaN 3698 360.77778 2018-12-26 18:40 8.00 820 837 846 854 NaN NaN NaN NaN NaN 2018-12-26 18:50 3599 380.78472 7.03 0.18 9.91 9.93 9.05 9.17 9.93 NaN NaN NaN NaN NaN 3600 350.8125 2018-12-26 13:30 7.14 7.28 7.78 7.85 7.91 7.96 NaN NaN NaN NaN NaN 2018-12-26 22:20 3601 360.93056 5.81 7.79 NaN NaN NaN NaN NaN mid_point unnamed: Unnamed: Unnamed: Unnamed: Unnamed: 100 height height data unnamed: Unnamed: freq fraction bins Decimal Day Date & Time Year 53.00 60.00 80.00 90.00 102.00 110.00 120.00 140.00 ignore ignore NaN NaN 12-1-18 0.00 335 0.11 0.12 0.21 0.24 0.26 0.27 0.29 0.34 NaN NaN NaN NaN 335.00694 2018-12-01 0.10 4.49 4.41 4.39 459 NaN NaN NaN NaN 335.01389 2018-12-01 0.20 432 433 431 NaN NaN NaN NaN 335.02093 2018-12-01 0.30 433 427 423 420 420 NaN NaN NaN NaN 2010-12-26 18:00 3597 360.75 9.12 7.89 7.91 0.09 0.24 0.24 0.01 NaN NaN NaN NaN NaN 3598 360.77778 2018-12-26 18:40 8.28 8.20 8.37 8.46 8.54 8.23 NaN NaN NaN NaN NaN 2018-12-26 19:50 3599 360.78472 7.03 8.91 8.93 9.05 9.17 NaN NaN NaN NaN NaN 3800 380.8125 2018-12-26 19:30 7.14 7.478 7.91 96 791 NaN NaN NaN NaN NaN 2010-12-26 22:20 3601 3680.93058 5.91 6.40 7.52 7.79 7.84 7.84 NaN NaN NaN NaN NaN 440
Close icon
Play audio
Feedback
Powered by NumerAI
Jennifer Stoner Kathleen Carty
David Collins verified

Akash M and 66 other subject AP CS educators are ready to help you.

Ask a new question

*

Labs

-

Want to see this concept in action?

NEW

Explore this concept interactively to see how it behaves as you change inputs.

View Labs

*

Key Concepts

-
Key Concept
Premium Feature
Explore the core concept behind this problem.
Play button
Key Concept
Premium Feature
Explore the core concept behind this problem.
Your browser does not support the video tag.

*

Recommended Videos

-
hi-i-am-trying-to-create-a-cart-function-in-python-and-i-am-totally-stuck-i-dont-know-where-even-to-begin-tree-structure-weve-provided-a-tree-structure-for-you-with-distinct-leaves-and-nodes-75418

Tree Structure: We've provided a tree structure for you with distinct leaves and nodes. Leaves have two fields: parent (another node) and prediction (a numerical value). Nodes have six fields: - left: node describing the left subtree - right: node describing the right subtree - feature: index of the feature to cut - cut: cutoff value c (<=c: left, and >c: right) - prediction: prediction at this node. This should be the average of the labels at this node. class TreeNode(object): """Tree class. (You don't need to add any methods or fields here, but feel free to if you like. The tests will only reference the fields defined in the constructor below, so be sure to set these correctly.) """ def __init__(self, left, right, feature, cut, prediction): self.left = left self.right = right self.feature = feature self.cut = cut self.prediction = prediction # The following is a tree that predicts everything as zero ==> prediction 0 # In this case, it has no left or right children (it is a leaf node) ==> left = None, right = None # The tree also does not split at any feature at any value ==> feature = None, cut = None root = TreeNode(None, None, None, None, 0) # The following is a tree with depth 2 or a tree with one split # The tree will return a prediction of 1 if an example falls under the left subtree # Otherwise, it will return a prediction of 2 # To start, first create two leaf nodes left_leaf = TreeNode(None, None, None, None, 1) right_leaf = TreeNode(None, None, None, None, 2) # Now create the parent or the root # Suppose we split at feature 0 and cut off at 1 # and the average prediction is 1.5 root2 = TreeNode(left_leaf, right_leaf, 0, 1, 1.5) # Now root2 is the tree we desired def cart(xTr, yTr): """Builds a CART tree. The maximum tree depth is defined by "maxdepth" (maxdepth=2 means one split). Each example can be weighted with "weights". Args: xTr: n x d matrix of data yTr: n-dimensional vector Returns: tree: root of the decision tree """ n, d = xTr.shape # YOUR CODE HERE raise NotImplementedError()

Akash M.


*

Recommended Textbooks

-
Computer Science and Information Technology

Computer Science and Information Technology

Trishna Knowledge Systems 2018 Edition
achievement 1,095 solutions
Introduction to Programming Using Python

Introduction to Programming Using Python

Y. Daniel Liang 1st Edition
achievement 1,309 solutions
Computer Science - An Overview

Computer Science - An Overview

Glenn Brookshear, Dennis Brylow 12th Edition
achievement 1,727 solutions

*

Transcript

-
00:01 In this question we have to implement a card algorithm in a python based on the tree structure.
00:06 So, here is a simplified version of the card function...
Need help? Use Ace
Ace is your personal tutor. It breaks down any question with clear steps so you can learn.
Start Using Ace
Ace is your personal tutor for learning
Step-by-step explanations
Instant summaries
Summarize YouTube videos
Understand textbook images or PDFs
Study tools like quizzes and flashcards
Listen to your notes as a podcast
Continue solving this problem
Create a free account to:
  • View full step-by-step solution
  • Ask follow-up questions with Ace AI
  • Save progress and study later
Continue Free
Join the community

18,000,000+

Students on Numerade


Trusted by students at 8,000+ universities

Numerade

Get step-by-step video solution
from top educators

Continue with Clever
or



By creating an account, you agree to the Terms of Service and Privacy Policy
Already have an account? Log In

A free answer
just for you

Watch the video solution with this free unlock.

Numerade

Log in to watch this video
...and 100,000,000 more!


EMAIL

PASSWORD

OR
Continue with Clever