How can I import 50 wavfiles at the same into Python to make dataframe ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How can I import 50 wavfiles at the same into Python to make dataframe ?

i am trying to import wavfiles into Python using from scipy.io import wavfile and i need to use a for loop. but i can't get the desired dataframe. could you please help me?

23rd Aug 2017, 3:26 PM
Sura Wankam
4 Answers
+ 7
scipy.io.wavfile.read() returns the bitrate of a wav file (integer) and its data as a numpy array. It can be transformed to pandas dataframe, by using pandas.DataFrame() method, where you put a list of all those 50 data objects as argument.
23rd Aug 2017, 6:57 PM
Kuba SiekierzyƄski
Kuba SiekierzyƄski - avatar
+ 7
Don't worry, pandas dataframes can manage and store extremely large collections of objects and still be efficient, as they only hold references to them. But sure, if you later need to do some data processing only on a selected piece of your files, there is no point in importing them in a first place ;)
23rd Aug 2017, 7:21 PM
Kuba SiekierzyƄski
Kuba SiekierzyƄski - avatar
0
i think i have to minimize the overall objects too because i actually have 2000 objects in a folder. but i need only 50 of them
23rd Aug 2017, 7:03 PM
Sura Wankam
0
thank you a lot
27th Aug 2017, 9:14 PM
Sura Wankam