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
Stels [109]
2 years ago
8

You are using a Jupyter Notebook to explore data in a DataFrame named productDF. You want to write some inline SQL by using the

following code, and visualize the results as a scatter plot: %%sql SELECT cost, price FROM product What should you do before running a cell with the %%sql magic? a. Create a new DataFrame named product from productDF.select("cost", "price") b. Persist the productDF DataFrame using productDF.createOrReplaceTempView("product") c. Filter the productDF dataframe using productDF.filter("cost == price") d. Rename the columns in the productDF DataFrame using productDF.withColumnRenamed("cost", "price")
Engineering
1 answer:
defon2 years ago
7 0
You need to explain it more simple as everyone is clueless
You might be interested in
Guys, can you rate this toolbox, please. It is my DT project, made for car trips, what do you think of the idea/design/usability
Maurinko [17]

Answer:

Honestly overall i think it looks fantastic

Explanation:

It looks like some really nice clean craftsmanship and i love the use of some different colors for some drawers to make it pop. the only con that i can possibly think of is that with it being wood and you moving it from place to place, some rubber feet or something that would prevent it from scratching/damaging anything else if it doesn't already (cant really see under it). other then that one thing i think it looks really good. well done.

3 0
3 years ago
Using the Distortion-Energy failure theory: 8. (5 pts) Calculate the hydrostatic and distortional components of the stress 9. (1
WITCHER [35]

Answer:

Detailed solution is given below:

7 0
3 years ago
Create a separate function file fieldtovar.m that receives a single structure as an input and assigns each of the field values t
Soloha48 [4]

Answer:

Explanation gives the answer

Explanation:

% Using MATLAB,

% Matlab file : fieldtovar.m

function varargout = fieldtovar(S)

% function that accepts single structure as input, assigning each

% of the field values to user-defined variables

fields = fieldnames(S); % get the field names of the input structure

% check if number of user-defined variables and number of fields in

% structure are equal

if nargout == length(fields)

% if equal assign each value of structure to user-defined varable

for i=1:nargout

varargout{i} = getfield(S,fields{i});

end

else

% if not equal display an error message

error('The number of output variables does not equal the number of fields');

end

end

%This brings an end to the program

4 0
3 years ago
A heat engine operates between 2 reservoirs at TH and 18oC. The heat engine receives 17,000 kJ/h from the high temperature reser
lisabon 2012 [21]

Answer:

See explaination

Explanation:

Please kindly check attachment for the step by step solution of the given problem

4 0
3 years ago
Your Java program will be reading input from a file name strInput.txt. Each record contains String firstname String lastName Str
stiks02 [169]

Answer:

The program requires that you have the specified input files and it reads from each file at a time and processes salary in digits, states the city, state and bonus with respective first and last name as requested in the question. Note that you must have access to the mentioned output files for the program to work properly. Below is the java version of the program.

import java.io.File;

import java.io.FileNotFoundException;

import java.io.PrintWriter;

import java.util.Scanner;

class Driver

{

public static void main(String[] args) throws FileNotFoundException

{

Scanner sc = new Scanner(new File("strInput.txt"));

PrintWriter pd = new PrintWriter(new File("strOutputD"));

PrintWriter prf = new PrintWriter(new File("strOutputRF"));

String firstname = "", lastname = "", strSalary = "", status = "", cityState = "", city = "", state = "";

double salary = 0, bonus = 0;

int incorrectRecords = 0;

int dRecords = 0;

int fRecords = 0;

while(sc.hasNextLine())

{

firstname = sc.next();

lastname = sc.next();

strSalary = sc.next();

status = sc.next();

cityState = sc.next();

if(!status.equals("D") && !status.equals("F"))

{

System.out.println("Records is neither D nor F. Skipping this...");

incorrectRecords++;

continue;

}

else if(status.equals("D") || status.equals("F"))

{

char c = ' ';

int i = 0;

for(i=0; i<strSalary.length() && c != '.'; i++)

{

c = strSalary.charAt(i);

if(!Character.isDigit(c))

{

System.out.println("Char at position " + (i+1) + " in salary is not a digit");

incorrectRecords++;

continue;

}

}

if(c == '.')

{

if(i+1 == strSalary.length()-1)

{

if(!Character.isDigit(strSalary.charAt(i)))

{

System.out.println("Char at position " + (i+1) + " in salary is not a digit");

incorrectRecords++;

continue;

}

if(!Character.isDigit(strSalary.charAt(i+1)))

{

System.out.println("Char at position " + (i+1+1) + " in salary is not a digit");

incorrectRecords++;

continue;

}

}

else

{

System.out.println("Period is in the wrong position. Expected at " + (strSalary.length()-3) + " but found at " + (i+1));

continue;

}

}

city = cityState.split(",")[0];

state = cityState.split(",")[1];

salary = Double.parseDouble(strSalary);

if(status.equals("D"))

{

bonus = salary * 0.125;

dRecords++;

pd.write(firstname + " " + lastname + " " + status + " " + salary + " " + bonus + " " + city + " " + state);

}

else

{

bonus = salary * 0.18;

fRecords++;

prf.write(firstname + " " + lastname + " " + status + " " + salary + " " + bonus + " " + city + " " + state);

}

}

}

System.out.println("No of D records : " + dRecords);

System.out.println("No of F records : " + fRecords);

System.out.println("No of incorrect records : " + incorrectRecords);

}

}

6 0
3 years ago
Other questions:
  • Hi, I have an assignment in which i needs to write a report on (Rationalization of electrical energy consumption) and i need cha
    6·1 answer
  • Establishes general guidelines concerning licensing and vehicle
    10·2 answers
  • Pennfoster Trades Safety test. Would appreciate the help. Thank you in advance. Check the screenshots below for the questions I'
    8·1 answer
  • What is engine knock? What cause the engine knock problem?
    5·1 answer
  • A reciprocating engine of 750mm stroke runs at 240 rpm. If the length of the connecting rod is 1500mm find the piston speed and
    9·1 answer
  • Calculate how large a mass would be necessary to obtain a mechanical noise limit of [Equation] = 1 nG, 1 µG, and 1 mG if the mec
    9·1 answer
  • Different Gauss quadrature formulae predict different values for the same integral a. True b. False
    11·1 answer
  • Describe a pro and con of having a passenger in the car
    11·1 answer
  • A tank with a volume of 40 cuft is filled with a carbon dioxide and air mixture. The pressure within the tank is 30 psia at 70oF
    12·1 answer
  • What is software certification? Discuss its importance in the changing scenario of software industry. ​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!