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
RideAnS [48]
2 years ago
12

Question 8 A data analyst is working with a data frame named stores. It has separate columns for city (city) and state (state).

The analyst wants to combine the two columns into a single column named location, with the city and state separated by a comma. What code chunk lets the analyst create the location column
Computers and Technology
1 answer:
jeka57 [31]2 years ago
3 0

The programing language, R has a unite unite function in the tidyr package. Hence, the code chunk which let's the analyst create the location column is; <em>unite (stores, "location”, city, state, sep=",") </em>

  • The syntax for the unite function is ; unite(data,col,..., sep)

  • <em>data</em><em> </em><em>=</em><em> </em><em>dataframe</em><em> </em><em>from</em><em> </em><em>which</em><em> </em><em>data</em><em> </em><em>is</em><em> </em><em>to</em><em> </em><em>be</em><em> </em><em>extracted</em><em> </em><em>`</em><em>;</em><em> </em>stores
  • <em>col</em><em> </em><em>=</em><em> </em><em>name</em><em> </em><em>of</em><em> </em><em>the</em><em> </em><em>new</em><em> </em><em>column</em><em> </em><em>;</em><em>"</em><em> </em>location"
  • <em>.</em><em>.</em><em>.</em><em> </em><em>=</em><em> </em><em>dataframes</em><em> </em><em>to</em><em> </em><em>be</em><em> </em><em>merged</em><em> </em><em>;</em><em> </em>city, state
  • <em>sep</em><em> </em><em>=</em><em> </em><em>seperator</em><em> </em><em>;</em><em> </em>","

Hence, the required syntax goes thus :

  • unite (stores, "location”, city, state, sep=",")

Learn more : brainly.com/question/25534959

You might be interested in
I need some help pleas hurry
Alexandra [31]
Opinion is the answer, every thing else can be compared with the data
8 0
2 years ago
NAME SEARCH In the Chap07 folder of the Student Sample Programs, you will find the following files: GirlNames.txt—This file cont
Tems11 [23]

Answer:

Explanation:

I do not have the files listed in the question so I have made two test files with the same names. This code is written in Python, we are assuming that the names on each file are separated by newlines.

f1 = open("GirlNames.txt", 'r')

f1_names = f1.read()

f1_names_list = f1_names.split('\n')

f2 = open("BoyNames.txt", 'r')

f2_names = f2.read()

f2_names_list = f2_names.split('\n')

print(f1_names_list)

print(f2_names_list)

boy_or_girl = input("Would you like to enter a boy or girl name or both: ").lower()

if boy_or_girl == 'boy':

   name = input("Enter name: ")

   if name in f2_names_list:

       print("Yes " + name + " is in the list of most popular boy names.")

   else:

       print("No, it is not in the list")

elif boy_or_girl == 'girl':

   name = input("Enter name: ")

   if name in f1_names_list:

       print("Yes " + name + " is in the list of most popular girl names.")

   else:

       print("No, it is not in the list")

elif boy_or_girl == 'both':

   girlname = input("Enter Girl name: ")

   if girlname in f1_names_list:

       print("Yes " + girlname + " is in the list of most popular girl names.")

   else:

       print("No, it is not in the list")

   boyname = input("Enter name: ")

   if boyname in f2_names_list:

       print("Yes " + boyname + " is in the list of most popular girl names.")

   else:

       print("No, it is not in the list")

else:

   print("Wrong input.")

4 0
3 years ago
/*
Lera25 [3.4K]

Answer:

The answer to this question can be given as:

Method:

public static void showTwos(int number)  //method definition.

{

method body.  

System.out.print(number + " = ");  //print number

while (number % 2 == 0)   //condition

{

System.out.print("2 * ");    //print message.

number = number / 2;

}

System.out.println(number);    //print value.

}

Explanation:

In the above method definition firstly, we declare the method showTwos() that name is already given in the question then we pass a variable number as a parameter in the method. In this first, we take input number from the user and pass into this method. In this method we use a while loop it is an entry control loop in this loop first we modules the number if it is equal to 0.Then we divide the number by 2 and in the last, we print the value.

4 0
2 years ago
Traffic flow analysis is classified as which?
Anna35 [415]

Answer:

c. An active attack

d. A passive attack​

Explanation:

Traffic flow analysis is a cyber attack method of acquiring information by intercepting and examining messages so as to decode them by analysing patterns in the way the messages are communicated.

Traffic flow analysis can either be active or passive depending on if the attacker alters communication in the case of active analysis or simply extracts information in case of passive analysis.  

8 0
2 years ago
Write a program (using functions) starting from directives to compute and display the transpose of a matrix of dimension m x n.
pentagon [3]

Answer:

#include <iostream>

#include <cstdlib>

using namespace std;

int m, n;

void transpose(int matrix[]){

  int transp[m][n];

  for (int i = 0; i < n; i++){

     for (int j = 0; j < m; j++){

        transp[j][i] = matrix[i][j];

        cout<< transp[j][i]<< " ";

     }

     cout<< "\n";

  }

}

int main(){

  cout<< "Enter the value for n: ";

  cin>> n;

  cout>> "Enter the value for m: ";

  cin>> m;

  int mymatrix[n][m];

  for (int i = 0; i < n; i++){

     for (int j = 0; j < m; j++){

        mymatrix[i][j] = (rand() % 50);

     }

  }

  transpose(mymatrix);

}

Explanation:

The C source code defined a void transpose function that accepts a matrix or a two-dimensional array and prints the transpose on the screen. The program gets user input for the row (n) and column (m) length of the arrays. The C standard library function rand() is used to assign random numbers to the array items.

3 0
3 years ago
Other questions:
  • ​You work at a call center of a large bank where you answer credit card services related questions from customers. Lately, you h
    14·1 answer
  • Queue is the LIFO structure.<br><br> o True<br><br> o False
    8·1 answer
  • Can you block someone on Brainly?
    7·2 answers
  • Suppose that Alice wants to send Bob a 50 kilobyte message over a 1 Gbps link. The total time required to transmit the message (
    5·1 answer
  • 1. What is the central idea of the section "Service Record." Use two text details to
    8·1 answer
  • A _____ is a harmful program that resides in the active memory of a computer and duplicates itself. Select one: a. scareware b.
    7·1 answer
  • Select the correct answer.
    12·2 answers
  • La sentencia de ASIGNAR es una sentencia de entrada de datos, verdadero o falso ?
    8·1 answer
  • Differences between dot_mattix printer and a line printer
    12·1 answer
  • A for construct is a loop construct that processes a specified list of objects. As a result, it is executed as long as there are
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!