Library for csv file
Working with CSV files using csv and pandas library in Python
Reading csv file in python
I am a beginner in Python and am working with .csv files. Can anyone help me on this exercise?
You need to attack this problem by breaking it into smaller chunks.
First you need to break your encoded machine name string into the relevant parts.
So "epdmolpd37901v" -> ("e", "pd", "molpd", ...)
Write a single function to do this. Note that with Python you can return multiple values from a single function. Test it independently.
I'll assume that the translations.csv file does not have many millions of rows. You can use the csv module to read the whole file into memory and create a dictionary where
translations = {
"P": "Production",
"E": "External User Acceptance",
...
}Again, write a function which reads this file and returns a dict as above and test this independently.
Next you need to loop through the hosts.csv file and for each row, call your function to break the name into parts and look up each part in the translations dict. Create a list of the original name and the translated parts, and output this as a row using the csv module.
More on reddit.comHi Guys. I'm a very newb in Python. I have learnt some basic Python (functions, loop...) and try to make use of Python into my daily job.
At the moment, my company want to expand to e-commerce, in this case, Shopify. My task is to data entry all the orders into our warehouse system. Shopify allows me to export all orders into csv file, and our warehouse system also allows me to mass import orders from a csv file too. I'm thinking of using Python to automatically modify Shopify csv to a format/layout which our warehouse system can read.
Can you guy point me into the direction/library which I can learn and achieve this task.
Thank you and much appreciated.