How to Read Multiple CSV Files in Python | For-Loop + 2 More

  Рет қаралды 33,554

Business Science

Business Science

Күн бұрын

Пікірлер: 20
@omarhossam285
@omarhossam285 3 жыл бұрын
great way but I found out this, it may help import os filepaths = [f for f in os.listdir(".") if f.endswith('.csv')] df = pd.concat(map(pd.read_csv, filepaths))
@nicolaslotsios1432
@nicolaslotsios1432 2 жыл бұрын
hello in what order are the elements imported? and how can i manipulate this order? thank you in advance
@qwqsimonade3580
@qwqsimonade3580 2 жыл бұрын
Which way takes least amount of time?
@evertonsston
@evertonsston Жыл бұрын
Simple and objective explanation! Thank you so much!
@BusinessScience
@BusinessScience Жыл бұрын
Glad it was helpful!
@osssosos
@osssosos Жыл бұрын
hi, how do you make the code results (output) appear in interactive like that
@tranglinh1087
@tranglinh1087 Жыл бұрын
thank you so much !
@satviksrivastava9504
@satviksrivastava9504 2 жыл бұрын
Hi, i have multiple csv files with each one having a json file describing it as well. I need to get some of that data from json file to csv file. How do i do that, i have around 80+ folders and each folder has around 100+ csv and json files. My lead says that the final data must be a csv file with each row of that csv file another csv file. I know it sounds ridiculous but i don't know how to proceed??
@BusinessScience
@BusinessScience 2 жыл бұрын
Sounds rough, but this is what I would do. I'd break the problem down into small tasks. Write loops only when one thing is working. Try the loop on a subset (not the whole thing). Address any errors / problems. Then scale to the full problem once you have built a small working code script.
@howardpiwang7779
@howardpiwang7779 2 жыл бұрын
How do I plot these multiple csv files on the same say 3dgraph
@KishorKumar-on2lw
@KishorKumar-on2lw 2 жыл бұрын
how to import different file names csv files
@tagifts
@tagifts 2 жыл бұрын
example is for .csv, but assuming that it works for any extension
@BusinessScience
@BusinessScience 2 жыл бұрын
Yes just change the reading function
@tucuongtran7960
@tucuongtran7960 2 жыл бұрын
how can I sort multiple csv files by "timestamp" and then rewrite it ? all in 1 folder and they all have the same headers.
@dishaverma8527
@dishaverma8527 2 жыл бұрын
I got NaN for the entire table after using concat.
@BusinessScience
@BusinessScience 2 жыл бұрын
Your path is probably not correct. This is what happens when the function cannot find the file.
@lambertnsengimana4104
@lambertnsengimana4104 2 жыл бұрын
How do you select automatically some files to import rather than importing all the files.
@ardmend
@ardmend 2 жыл бұрын
specify the file path? use os
Turning multiple CSV files into a single pandas data frame
8:09
Python and Pandas with Reuven Lerner
Рет қаралды 31 М.
Creative Justice at the Checkout: Bananas and Eggs Showdown #shorts
00:18
Fabiosa Best Lifehacks
Рет қаралды 34 МЛН
99.9% IMPOSSIBLE
00:24
STORROR
Рет қаралды 20 МЛН
Why no RONALDO?! 🤔⚽️
00:28
Celine Dept
Рет қаралды 102 МЛН
Three ways to read CSV data into Python
9:59
Python and Pandas with Reuven Lerner
Рет қаралды 6 М.
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 107 МЛН
How to work with big data files (5gb+) in Python Pandas!
11:20
TechTrek by Keith Galli
Рет қаралды 41 М.
Processing Multiple .csv Files Using Pandas in Python #AsmaaHadane
17:28
Import multiple datasets and plot in Python
12:17
Dr Manab
Рет қаралды 1,2 М.
This INCREDIBLE trick will speed up your data processes.
12:54
Rob Mulla
Рет қаралды 269 М.
Read Giant Datasets Fast - 3 Tips For Better Data Science Skills
15:17
Python Simplified
Рет қаралды 54 М.
Creative Justice at the Checkout: Bananas and Eggs Showdown #shorts
00:18
Fabiosa Best Lifehacks
Рет қаралды 34 МЛН