I am new to programming (but not to the concepts) and I need to process some .csv files. Here's what I have:
The files containing Cartesian coordinates, XYZ of various "polygons." (They are cell perimeters of a mouse embryo) The polygons are in quotes because they are not closed, and I need Python to close them for me. So what I want to do is use Python to: (in general terms)
Go to cell 1
Find start point coordinate(s) It will always be "A."
Copy those values
Find endpoint coordinate(s) This will vary, and I need to set bounds here, as the drawing s/w sets the points down as A-Z then restarts from A again! But that's another script that I believe will be trivial to create. (I could easily write a Excel macro to handle that problem)
Copy those values
Sum the values and average (divide by two)
Paste those values as the new beginning and end points. Closes the polygon.
Go to cell 2 - repeat until end.
I figure I must process each cell three times. I first sum and average the value for X, then do it again for Y, then finally for Z. I'm also guessing I will need a sandbox to paste the new value (twice - once at start, once at end), and insert between the those points the other values, the ones for B through the unknown penultimate value.
So my questions are: Am I thinking this through right? And - are there any examples from which I could copy the methodology? It's much easier to follow directions or the path of someone else then it is to build from scratch.
I intend to pre-process the files and so can delete/ insert Carriage Returns or other things between the coordinates and cells to make my script easier to code. I'm working in Bitplane's Imaris software if you're familiar with the image source files. Thanks!
Onkel Bob
0
Newbie Poster
Recommended Answers
Jump to PostAh, I hate general terms! :P
Could you provide sample data and what your expected outcome is?
I am assuming you want to take each cell's parameter and document any change (growth or decay).
Simplistic example:
X = 5
Y = 5
Z = 5You …
Jump to PostTry this tutorial it may help you:
http://uninsubria.academia.edu/documents/0023/6072/Choirat-Seri-JAE-2009.pdf.
Is basics of csv but it may be useful to start.
All 5 Replies
Xydric
0
Newbie Poster
Dan08
8
Junior Poster
Onkel Bob
0
Newbie Poster
Xydric
0
Newbie Poster
Onkel Bob
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.