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
horsena [70]
3 years ago
10

Using a third-party package of your choice, write a program that reads the contents of a csv file and saves it to an Excel file.

The program should take two arguments. The name of the input file and the name of the output file.
Computers and Technology
1 answer:
laiz [17]3 years ago
4 0

Answer:

import pandas as pd

df = pd.read_csv("file_csv")

df.to_excel("file.xlsx", sheet_name = "name_of_sheet")

# or use: with df.ExcelWriter("file.xlsx", mode='a') as file,

#df.to_excel(file, sheet_name= "sheet name")

Explanation:

This python source code uses the pandas package to read csv (comma separated values) file and converts it to an excel file (xlsx) using the read_csv and ExcelWriter methods respectively.

You might be interested in
Key
marin [14]

Answer:

It will output N (15).

Explanation:

N = Input() Means that you are in-taking userdata, and as it states, they put in 15. Hence, N = 15. A = Input() is the same process, except they wrote 10. So A = 10.

Then, we measure is N > A. Is 15 > 10? Yeah.

Therefore, this is TRUE, so we follow the TRUE path. This will "Output N" (A fancy way of saying, 'hey compiler, write the value of N onto the user's screen'), This means it will output 15.

8 0
3 years ago
What is one way in which tablets differ from laptops and notebooks
olga55 [171]
One way is the tablet is more portable in the hand and has a virtual keyboard.

6 0
4 years ago
Read 2 more answers
write a function named list_total that accepts a list as an argument (assume the list contains integers) and returns the cumulat
lutik1710 [3]

Answer:

def listSum(mylist):

  sum =0

  for item in range(0,len(mylist)):

      sum=sum+mylist[item]

  print(sum)

Explanation:

Using the Python programming language, I defined a function as listSum that accepts a list as a parameter and returns the sum of the elements in the list.

The most important logic here is defining the range of elements in the list not to exceed the length of the list using the len function. Then using a for statement, we loop through each element and add them up to a sum variable initially assigned the value of 0.

3 0
3 years ago
A company uses DHCP servers to dynamically assign IPv4 addresses to workstations. The address lease duration is set as 5 days. A
nikitadnepr [17]

Answer:

FF-FF-FF-FF-FF-FF and 255.255.255.255

Explanation:

FF-FF-FF-FF-FF-FF can be defined as the layer 2 address broadcast which is often used on ethernet frames as well as help to broadcast all equipment due to the fact broadcast is made possible through Ethernet networks in which the Frames are addressed to reach every computer system on a given LAN segment as far as they are addressed to MAC address FF:FF:FF:FF:FF:FF.

255.255. 255.255 can be seen as the layer 3 address which help to address the exact same hosts because it enables the broadcast address of the zero network which is the local network due to the fact that the IP broadcasts are often used by BOOTP and DHCP clients to find and send requests to their respective servers in which a message sent to a broadcast address may be received by all network-attached hosts.

Therefore the Layer 2 and Layer 3 destination addresses which the message contain are FF-FF-FF-FF-FF-FF and 255.255.255.255

7 0
4 years ago
3. (20 points) Write a C++ recursive function that finds the maximum value in an array (or vector) of integers without using any
Luden [163]

Answer:

Following are the code to this question:

In option (i):

#include <iostream>//defining header file

using namespace std;

int findMax(int B[], int x)//defining recursive method findMax

{

if (x == 1)//defining condition when value of n==1

return B[0];//return array first element

return max(B[x-1], findMax(B, x-1)); // calling recursive method inside max method and return value

}

int main() //defining main method  

{

int B[] = {12, 24, 55, 60, 50, 30, 29};//defining array B

int x= 7;//defining integer variable and assign a value

cout << "Maximum element value of the array is: "<<findMax(B, x)<<endl;//calling method findMax and print value

return 0;

}

Output:

Maximum element value of the array is: 60

In option (ii):

\Rightarrow \ T(n) = 1 + T(n-1)\\\Rightarrow  1 + 1 + T(n-2)\\ \Rightarrow  1 + 1 + 1 + ... n \ times \\\Rightarrow  O(n) \\

Explanation:

In the above-given program a recursive method "findMax" is defined, which accepts an array "B" and an integer variable "n" in its parameter, inside the method a conditional statement is used that, checks value of x equal to 1.

  • If the above condition is true it will return the first element of the array and find the max number.
  • Inside the main method, an array B is declared that assigns some values and an integer variable is declared, that also assigns some values, in the last step print method is used that pass value in method and prints its return value.
  • In the option (ii) we calculate the Big-O notation algorithm value.
5 0
4 years ago
Other questions:
  • This question involves the creation of user names for an online system. A user name is created based on a user’s first and last
    13·1 answer
  • Which of the following is a disadvantage of using a personality assessment to determine who is well suited for a work position?
    7·2 answers
  • Select three examples of cryptographs. Security tokens Shared-key Malware Firewalls Message authentication code Public-key
    7·2 answers
  • Two electronics technicians are looking at the piece of testing equipment shown in the figure above. Technician A says that this
    10·1 answer
  • Microsoft windows is the least used operating system true or false?
    15·2 answers
  • 17. Which of the following is not a visible section in a File Explorer window?
    8·1 answer
  • Pros of mobile devices on young people during their free time
    5·1 answer
  • Given the following program: public class MysteryNumbers { public static void main(String[] args) { String one = "two"; String t
    13·1 answer
  • Which of the following identifies the patterns used for each data series in a chart?
    12·1 answer
  • PHP can be run on Microsoft Windows IIS(Internet Information Server):
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!