Skip to content

Tag: csv

Data loss while extracting the rows from large csv file

This is in continuation from my previous question. I have 2 files, file1.csv and a large csv called master_file.csv. They have several columns and have a common column name called EMP_Code. File 1 example: EMP_name EMP_Code EMP_dept b f367 abc a c264 xyz c d264 abc master_file example: I want to extract similar rows from master_file using all the EMP_Code

Unable to scrape jpg images link from json

I’m trying to scrape jpg images from each products, every product url saved in csv. Image links are available in json data so try to access json key value. When I try to run code it’s only getting back with all key value in spite of image url link, and second my code only able to scrape last product url

Remove empty lists in csv file in python

So I have a csv file called result and I’m getting this: when I just want this: as in without the empty lists. How would I go about doing this? I tried to do and I tried this: and I tried this: but none of them worked. Answer EDITED (after collecting more information): I do think that attempting to work

Extract first available day for each month from a csv

Stock quotes obtained from yfinance don’t start the 1st of each month, so I need to extract the the Date and Close for the first available qupte for each month in a csv. So far I managed to only get the days starting with 0, but this is still not what I want: The following is an example of what

Find and replace no updating values

I’m writing a script that combine csv into one and then do a find an replace for specific formatting and ask the user to correct the ones that not match. The output is not on the right csv format It should be Answer This problems has a number of different parts, and you’ve made a good attempt :) I recommend

Python chunks write to excel

I am new to python and I m learning by doing. At this moment, my code is running quite slow and it seems to take longer and longer by each time I run it. The idea is to download an employee list as CSV, then to check the location of each Employee ID by running it trough a specific page

Converting dataframe to dictionary with country by continent

I have a .csv and dataframe which has 2 columns (country, continent). I want to create a dictionary, carrying the continent as key and a list of all countries as values. The .csv has the following format: country continent Algeria Africa Angola Africa and so on. I tried using: But this gave me the following output: Which is the right

Json to CSV file conversion using python

I have a sample JSON file like this i need to take only specific key and values from the json file and convert it into a CSV file Code: Ref:Extracting Specific Keys/Values From A Messed-Up JSON File (Python) When I’m passing 2 values through the extract(), getting NaN in between result I need to get an output like the below

How to find the index of certain lists in a list of lists?

I have 50 folders containing the same file name but different contents Data_220_beta_0.1_47.0_53.0ND.csv. I am skipping certain folders which is mentioned in list I. Now, when the code scans all the remaining folders, it looks for values which are different and X = [x for x in X if min(x) != max(x)] contains the lists with distinct values. How do