1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
ZanzabumX [31]
3 years ago
14

1.11 LAB: Data frames

Computers and Technology
1 answer:
grigory [225]3 years ago
4 0

To work with data frames in python, the pandas library ls very efficient. Therefore, the following lines of code will <em>load, subset and display the maximum value</em> of each column in the subset :

import pandas as pd

<em>#This</em><em> </em><em>imports</em><em> </em><em>the</em><em> </em><em>pandas</em><em> </em><em>dataframe</em><em> </em><em>and</em><em> </em><em>alias</em><em> </em><em>it</em><em> </em><em>as</em><em> </em><em>pd</em><em> </em>

df_cars = pd.DataFrame('Cars.csv')

<u>Subsetting the firsts UserNum row</u> :

Using the index location method, the first userNum row has a row index of 0.

df_subset = df.iloc[:0, :]

<em>#this</em><em> </em><em>selects</em><em> </em><em>only</em><em> </em><em>the</em><em> </em><em>first</em><em> </em><em>row</em><em> </em><em>and</em><em> </em><em>all</em><em> </em><em>the</em><em> </em><em>columns</em><em> </em>

<em>#first</em><em> </em><em>row</em><em> </em><em>of</em><em> </em><em> </em><em>df_cars</em><em> </em><em>dataframe</em><em> </em><em>has</em><em> </em><em>been</em><em> </em><em>assigned</em><em> </em><em>to</em><em> </em><em>another</em><em> </em><em>dataframe</em><em> </em><em>called</em><em> </em><em>the</em><em> </em><em>df_subset</em>

df_subset.max()

<em>#the</em><em> </em><em>max</em><em> </em><em>function</em><em> </em><em>returns</em><em> </em><em>the</em><em> </em><em>maximum</em><em> </em><em>value</em><em> </em><em>for</em><em> </em><em>each</em><em> </em><em>column</em><em> </em>

<em>Note</em><em> </em><em>:</em><em> </em><em>the</em><em> </em><em>cars.csv</em><em> </em><em>data</em><em> </em><em>wasn't</em><em> </em><em>provided</em><em>,</em><em> </em><em>However</em><em>,</em><em> </em><em>this</em><em> </em><em>is a</em><em> </em><em>run-through</em><em> </em><em>of</em><em> </em><em>how</em><em> </em><em>to</em><em> </em><em>get</em><em> </em><em>the</em><em> </em><em>required</em><em> </em><em>output</em><em>.</em><em> </em>

Learn more :brainly.com/question/16183131?referrer=searchResults

You might be interested in
What are the chief contributions of philosophy to artificial intelligence?
olga nikolaevna [1]

Answer

Hi,

The chief contribution of philosophy to artificial intelligence is the knowledge of the connections between the two and the understanding of the shared concept.

Explanation

Philosophy and Artificial intelligence has a close scientific connection because they both share concepts such as action, consciousness, epistemology and free will. From the artificial intelligence perspective, theories in philosophy are important in AI as long as they provide the basis of the designs, reasons and plan. The concepts shared in AI con tribute to the realization of the philosophy of artificial intelligence.

Hope this Helps!

5 0
3 years ago
In the classic experimental design, there are two groups: the _____ group and the _____ group.
Tju [1.3M]

Main Answer:In the classic experimental design, there are two groups: the <u>treatment group and the control group.</u>

<u>Sub heading:</u>

<u>Explain treatment group and control group?</u>

Explanation:

1.The treatment group also known as the experimental group receives the treatment that the researcher is evaluating.

2.the control group  on the other hand does not receive the treatment.

Reference link:

https://brainly.com

Hashtag:

#SPJ4

5 0
2 years ago
Can someone help my friend play over-watch she new do it. I can't help her on Friday (p.s she play on Xbox she will get it on Fr
ss7ja [257]

There should be a place on the Xbox where you can download games. Go there and type in overwatch.

Hope this helped!

5 0
3 years ago
If we recorded the average U.S. Housing Price every month for the next year, what graphical display is most appropriate to displ
JulijaS [17]

Answer:

Time plot.

Explanation:

A time plot, also known as a time series can be defined as a graphical representation of a pre-defined value (data) against time.

If we recorded the average U.S. Housing Price every month for the next year, the graphical display which  is most appropriate to display the data is a time plot.

Generally, when representing data that changes with respect to time or that are random in nature; a time plot is considered to be the most effective graphical display to use.

In this scenario, the average U.S. Housing Price that is observed should be plotted against the time of occurrence (months) over a year.

3 0
3 years ago
Match the feature to its function. 1. Normal view provide rows of icons to perform different tasks 2. Notes view an area in whic
pashok25 [27]

Answer:

Match the feature to its function.  The answers are as below:

1. Normal view the place where creating and editing occurs  

2. Notes view an area in which information for handouts can be added  

3. Slide pane the place where the slide order can be changed

4. Menu bar contains lists of commands used to create presentations  

5. toolbars provide rows of icons to perform different tasks  

Explanation:

It is the normal view where the editing and the creation of the slides occur. And it's the notes view where you can add the information for handouts. You can arrange the slides in the slide pane. And you can get a list of commands for creating the presentation in the Menu bar. Also, Toolbar is the rows of icons which helps in performing a various set of tasks. And all these are definitions and prove our above selections are correct.

6 0
3 years ago
Read 2 more answers
Other questions:
  • 4. When determining the tone of their tweets, marketers should consider
    8·1 answer
  • What is an implicit benefit to Monetary Policy?
    6·1 answer
  • Explain the four basic operation performed by every computer​
    11·2 answers
  • Which term describes the order of arrangement of files and folders on a computer?
    10·1 answer
  • What do you need to know when buying screws<br>​
    12·2 answers
  • Create the following new exceptions: PokemonException, which extends the Exception class. It must have a no-parameter constructo
    13·1 answer
  • NEED ANSWERS ASAP
    6·2 answers
  • What are the cloud storage components
    6·1 answer
  • DOES ANYONE KNOW COMPUTER SCIENCE?
    8·1 answer
  • A _______ is a group of elements that you want to style in a particular way.
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!