using python programming language
write a program that will manipulate the below excel record to the output provided
This is what the output should look like
# I am assuming that the path column of excel contains all the comma-separated entries which are in the output and same for IDs.
# coding: utf-8
# In[1]:
import pandas as pd
import numpy as np
# requirement: intall xlrd using pip install xlrd
# install openpyxl using pip install openpyxl
# In[2]:
file = 'data.xlsx' # path to excel file
data = pd.read_excel(file) # reading excel file using pandas
(remember excel file has a header)
# In[3]:
print(data) # printing data in excel file
# In[4]:
new_data = pd.DataFrame(columns=['Name','Path','ID']) # create
empty data frame
for row in data.values: # for each row of data (excel file)
paths = row[1].split(',') # split the paths into list of path
ids = row[2].split(',') # split IDs into list of id
name = row[0] # name of row
for path, ID in zip(paths, ids): # adding each name, path, id into
the new data frame
new_data = new_data.append(pd.DataFrame([{'Name': name, 'Path':
path, 'ID': ID}]), ignore_index=True)
# In[7]:
new_data = new_data[['Name', 'Path', 'ID']] # rearranging the
column names and corresponding columns
writer = pd.ExcelWriter('new_data.xlsx') # Saving the new data set
into new excel file
new_data.to_excel(writer, index=False)
writer.save()
# In[8]:
print(new_data)
using python programming language write a program that will manipulate the below excel record to the...
Python Language Only!!!! Python Language Only!!!! Python Language Only!!!! Python 3 is sued. Write a Python code that gets a string containing a person’s first, middle, and last name, and print her/his last name, followed by comma and the first name initial. For example, if the user enters Randy Rick Gomez, the program should display Gomez, R. Please note that in the output, the first character of each name should be capital. Please see the outcomes below: Outcome: Enter your...
I am using programming language of DEV C++, and here is my assignment. Write a program, maxmin.c to find the maximum and minimum of values in the file maxminin.txt. Your output should look like: There are 6 values in the file The maximum value is 9.500000 The minimum value is 1.100000 and this is maxminin.txt: 8.2 1.1 3.7 2.2 9.5 4.3
Python Programming 4th Edition Write a program that calculates the length of a right triangle's hypotenuse. Hints: Define main() program Get the length of the triangle’s two sides (user input) Call math function to calculate the length of the hypotenuse. The output should look like as follows: The length of the hypotenuse is 12.041594578792296
Python 3.6 I need the code ready to run using GUI programming Write a program for the Knight's Tour problem. Your program should let the user move a knight to any starting square and click the Solve button to animate a knight moving along the path, as shown below.
Please write comments with the program. Python programming!! Part III - write student data In this part the program should create a .csv file and fill it with generated student information. The program should: Ask the user for a name for the .csv file (use your own name for the exercise) Create the .csv file with columns named - ID, first-name, GPA Based on the information received in part I, generate and fill students information in the CSV file Tell...
Programming Language : Python Question a) Are there any programming framework for this language? If yes, where and how do you get them (URL) ? b) What is (are) the program development environments (s) available for this language? and what is provided in each program development environment?
Python Programming 4th Edition: Write a program that asks the user for the number of feet. The program converts those feet to inches by using the formula ’12 * feet’. Hint: Define main () program Get the number of feet from the user Define variables Call a function feet_to_inches(feet) The function receives the number of feet and returns the number of inches in that many feet. The output should look like as follows: Enter the number of feet: If the...
Using your programming language of choice, write a program that will ask for: Probability of A Probability of B Probability of B given A and will then output the probability of A given B using Bayes Theorem. You can prompt for input anyway you like (command line, GUI, website, etc), and return the result any way you like (command line, GUI, website, etc).
C++ Programming Write a C++ program that defines the 5 times 5 grid shown below. The program should then call a method to display the grid. The output should look like this: char board[5][5] =
Use Python programming #3 on page 47 of your python programming book: Write a Tipper program where the user enters a restaurant bill total. The program should then display two amounts: a 15% tip and a 20% tip. Name your file tipper.py Previous Next.