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
DochEvi [55]
3 years ago
14

In Lab 7, we worked through a program that displayed the homeless shelter occupancy over time. The same approach can be used for

displaying any dataset where the date and time are stored. For this program, use the lab as a starting point to display public school attendance from NYC OpenData. If you would like to test your program on other data, you can filter for an individual school by viewing the data and filtering on the school number ("School DBN"). Export the file as CSV and save. There is a sample file for the high school on campus on github Modify the program from Lab 7 that displays shelter population over time to: Ask the user to specify the input file, Ask the user to specify the output file, Convert the date column (which is stored as 'YYYYMMDD') to a datetime format recognized by pandas, for example if your dataframe is df, overwrite the 'Date' column to be: df["Date"] = pd.to_datetime(df["Date"].apply(str)) Make a plot of the percent of absent students over time from the data in the input file, and Store the plot in the output file the user specified. A sample run of the program: Enter name of input file:

Engineering
1 answer:
Bezzdna [24]3 years ago
6 0

Answer:

Explanation:

The python code to generate this is quite simple to run.

i hope you understand everything written here, you can as well try out other problems to understand better.

First to begin, we import the package;

Code:

import pandas as pd

import matplotlib.pyplot as plt

name = input('Enter name of the file: ')

op = input('Enter name of output file: ')

df = pd.read_csv(name)

df['Date'] = pd.to_datetime(df["Date"].apply(str))

plt.plot(df['Date'],df['Absent']/(df['Present']+df['Absent']+df['Released']),label="% Absent")

plt.legend(loc="upper right")

plt.xticks(rotation=20)

plt.savefig(op)

plt.show()

This should generate the data(plot) as seen in the uploaded screenshot.

thanks i hope this helps!!!

You might be interested in
Thread cancellation is : Group of answer choices c) the task of terminating a thread before it has completed a) the task of dest
Mariana [72]

Answer:

Thread cancellation is the task of terminating a thread before it has completed.

Explanation:

In computers and technology, the concept of thread cancellation explains how a thread can be stopped while it is still in the process of execution.

It can also be done in such a way that it checks at intervals if it can safely cancel itself before it then proceeds with the cancellation.

3 0
3 years ago
A conical enlargement in a vertical pipeline is 5 ft long and enlarges the pipe diameter from 12 in. to 24 in. diameter. Calcula
makkiz [27]

Answer:

F_y = 151319.01N = 15.132 KN

Explanation:

From the linear momentum equation theory, since flow is steady, the y components would be;

-V1•ρ1•V1•A1 + V2•ρ2•V2•A2 = P1•A1 - P2•A2 - F_y

We are given;

Length; L = 5ft = 1.52.

Initial diameter;d1 = 12in = 0.3m

Exit diameter; d2 = 24 in = 0.6m

Volume flow rate of water; Q2 = 10 ft³/s = 0.28 m³/s

Initial pressure;p1 = 30 psi = 206843 pa

Thus,

initial Area;A1 = π•d1²/4 = π•0.3²/4 = 0.07 m²

Exit area;A2 = π•d2²/4 = π•0.6²/4 = 0.28m²

Now, we know that volume flow rate of water is given by; Q = A•V

Thus,

At exit, Q2 = A2•V2

So, 0.28 = 0.28•V2

So,V2 = 1 m/s

When flow is incompressible, we often say that ;

Initial mass flow rate = exit mass flow rate.

Thus,

ρ1 = ρ2 = 1000 kg/m³

Density of water is 1000 kg/m³

And A1•V1 = A2•V2

So, V1 = A2•V2/A1

So, V1 = 0.28 x 1/0.07

V1 = 4 m/s

So, from initial equation of y components;

-V1•ρ1•V1•A1 + V2•ρ2•V2•A2 = P1•A1 - P2•A2 - F_y

Where F_y is vertical force of enlargement pressure and P2 = 0

Thus, making F_y the subject;

F_y = P1•A1 + V1•ρ1•V1•A1 - V2•ρ2•V2•A2

Plugging in the relevant values to get;

F_y = (206843 x 0.07) + (1² x 1000 x 0.07) - (4² x 1000 x 0.28)

F_y = 151319.01N = 15.132 KN

6 0
3 years ago
A motor car shaft consists of a steel tube 30 mm internal diameter and 4 mm thick. The engine develops 10 kW at 2000 r.p.m. Find
tresset_1 [31]

The maximum shear stress in the tube when the power is transmitted through a 4: 1 gearing is 28.98 MPa.

<h3>What is power?</h3>

Power is the energy transferred per unit time.

Torque is find out by

P = 2πNT/60

10000 = 2π x 2000 x T / 60

T =47.74 N.m

The gear ratio Ne / Ns =4/1

Ns =2000/4 = 500

Ts =Ps x 60/(2π x 500)

Ts =190.96 N.m

Maximum shear stress τ = 16/π x (T / (d₀⁴ - d₁⁴))

τ max =T/J x D/2
where d₁ = 30mm = 0.03 m

           d₀ = 30 +(2x 4) = 38mm =0.038 m

Substitute the values into the equation, we get

τ max = 16 x 190.96 x 0.038 /π x (0.038⁴ - 0.03⁴)

τ max = 28.98 MPa.

Thus, the maximum shear stress in the tube is 28.98 MPa.

Learn more about power.

brainly.com/question/13385520

#SPJ1

7 0
2 years ago
Implement
kolbaska11 [484]

Answer:

#include <iostream>

using namespace std;

// Pixel structure

struct Pixel

{

unsigned int red;

unsigned int green;

unsigned int blue;

Pixel() {

red = 0;

green = 0;

blue = 0;

}

};

// function prototype

int energy(Pixel** image, int x, int y, int width, int height);

// main function

int main() {

// create array of pixel 3 by 4

Pixel** image = new Pixel*[3];

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

image[i] = new Pixel[4];

}

// initialize array

image[0][0].red = 255;

image[0][0].green = 101;

image[0][0].blue = 51;

image[1][0].red = 255;

image[1][0].green = 101;

image[1][0].blue = 153;

image[2][0].red = 255;

image[2][0].green = 101;

image[2][0].blue = 255;

image[0][1].red = 255;

image[0][1].green = 153;

image[0][1].blue = 51;

image[1][1].red = 255;

image[1][1].green = 153;

image[1][1].blue = 153;

image[2][1].red = 255;

image[2][1].green = 153;

image[2][1].blue = 255;

image[0][2].red = 255;

image[0][2].green = 203;

image[0][2].blue = 51;

image[1][2].red = 255;

image[1][2].green = 204;

image[1][2].blue = 153;

image[2][2].red = 255;

image[2][2].green = 205;

image[2][2].blue = 255;

image[0][3].red = 255;

image[0][3].green = 255;

image[0][3].blue = 51;

image[1][3].red = 255;

image[1][3].green = 255;

image[1][3].blue = 153;

image[2][3].red = 255;

image[2][3].green = 255;

image[2][3].blue = 255;

// create 3by4 array to store energy of each pixel

int energies[3][4];

// calculate energy for each pixel

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

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

energies[i][j] = energy(image, i, j, 3, 4);

}

}

// print energies of each pixel

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

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

// print by column

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

}

cout << endl;

}

}

// function prototype

int energy(Pixel** image, int x, int y, int width, int height) {

// get adjacent pixels

Pixel left, right, up, down;

if (x > 0) {

left = image[x - 1][y];

if (x < width - 1) {

right = image[x + 1][y];

}

else {

right = image[0][y];

}

}

else {

left = image[width - 1][y];

if (x < width - 1) {

right = image[x + 1][y];

}

else {

right = image[0][y];

}

}

if (y > 0) {

up = image[x][y - 1];

if (y < height - 1) {

down = image[x][y + 1];

}

else {

down = image[x][0];

}

}

else {

up = image[x][height - 1];

if (y < height - 1) {

down = image[x][y + 1];

}

else {

down = image[x][0];

}

}

// calculate x-gradient and y-gradient

Pixel x_gradient;

Pixel y_gradient;

x_gradient.blue = right.blue - left.blue;

x_gradient.green = right.green - left.green;

x_gradient.red = right.red - left.red;

y_gradient.blue = down.blue - up.blue;

y_gradient.green = down.green - up.green;

y_gradient.red = down.red - up.red;

int x_value = x_gradient.blue * x_gradient.blue + x_gradient.green * x_gradient.green + x_gradient.red * x_gradient.red;

int y_value = y_gradient.blue * y_gradient.blue + y_gradient.green * y_gradient.green + y_gradient.red * y_gradient.red;

// return energy of pixel

return x_value + y_value;

}

Explanation:

Please see attachment for ouput

6 0
3 years ago
A shaft made of stainless steel has an outside diameter of 42 mm and a wall thickness of 4 mm. Determine the maximum torque T th
fiasKO [112]

Answer:

Explanation:

Using equation of pure torsion

\frac{T}{I_{polar} }=\frac{t}{r}

where

T is the applied Torque

I_{polar} is polar moment of inertia of the shaft

t is the shear stress at a distance r from the center

r is distance from center

For a shaft with

D_{0} = Outer Diameter

D_{i} = Inner Diameter

I_{polar}=\frac{\pi (D_{o} ^{4}-D_{in} ^{4}) }{32}

Applying values in the above equation we get

I_{polar} =\frac{\pi(0.042^{4}-(0.042-.008)^{4})}{32}\\I_{polar}= 1.74 x 10^{-7} m^{4}

Thus from the equation of torsion we get

T=\frac{I_{polar} t}{r}

Applying values we get

T=\frac{1.74X10^{-7}X100X10^{6}  }{.021}

T =829.97Nm

7 0
3 years ago
Other questions:
  • In adopt me, (Roblox) should I trade my fly ride neon penguin for a car,2 shibu inus and a fly ride neon unicorn?????? This is n
    15·2 answers
  • The longest_word function is used to compare 3 words. It should return the word with the most number of characters (and the firs
    8·1 answer
  • Impact strips may be designed into a bumper cover.<br> True<br> False
    14·1 answer
  • Why is tesla better than Edison
    11·1 answer
  • Q.17) A 50-acre catchment containing cropland is converted ot a Qatar mail
    13·1 answer
  • Please help due by end of the day!!!! I need the code for 5 and 7, Milky Way in coderz. will mark brainliest answer.
    10·2 answers
  • PLEEEAASSSSEEEE HELP ME!!
    13·1 answer
  • Pls help!!! will give brainy!!!
    11·1 answer
  • Consider a 25-mm-diameter and 15-m-long smooth tube that is maintained at a constant surface temperature. Fluids enter the tube
    12·1 answer
  • A 10 kg mass is lifted to a height of 2 m What is the potiental energy at this position
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!