Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Write in a csv file
I receive a data stream i want to record in a variable (array, list or dictionnary) and then write these data in a csv file.
My streamed data are coordinates of multiple marker. Hence at each loop i receive a data frame (marker1:x,y,z; marker 2:x,y,y ect..), so for exemple with 4 markers i receive 12 streamed data at each loop.
I would like to write these data in a csv file like this (data separated with tabulation):

marker 1.... marker 2....marker3 ect...
x y z......x y z......x y z
1 2 3......5 5 6......4 9 8
4 5 6......7 2 4......4 6 5

It seems simple but i really don't know what/how i can use array, list or dictionnary to do that.
Any help please?
you can do it directly in pandas, see:

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Does python guarantees that file.write() works without file.close() ? kryptomatrix 7 189 Oct-21-2019, 11:28 AM
Last Post: kryptomatrix
  How do I read the HTML files in a directory and write the content into a CSV file? glittergirl 1 115 Sep-23-2019, 11:01 AM
Last Post: Larz60+
  How do I write class objects to a file in binary mode? Exsul1 7 417 Sep-14-2019, 09:33 PM
Last Post: snippsat
  how do i write a cross-platform relative file path? pseudo 2 129 Aug-23-2019, 05:07 PM
Last Post: ThomasL
  write to txt file one line antmar904 3 246 Aug-16-2019, 02:40 PM
Last Post: Axel_Erfurt
  read text file and write into html with correct link jacklee26 4 242 Aug-02-2019, 05:48 AM
Last Post: jacklee26
  is it possible to use python to read and write from a jsx file? nadavrock 3 357 Jun-08-2019, 02:59 AM
Last Post: heiner55
  write image into string format into text file venkat18 2 384 Jun-01-2019, 06:46 AM
Last Post: venkat18
  How to write to csv file SriMekala 1 183 May-14-2019, 01:58 PM
Last Post: buran
  how can I write my function output on CSV file go127a 13 585 May-05-2019, 01:55 PM
Last Post: go127a

Forum Jump:

Users browsing this thread: 1 Guest(s)