0% found this document useful (0 votes)
40 views5 pages

Data Analysis in Python: Reading Files

This document presents a solution for reading numeric data from a text file and converting it to floating point numbers ("float") for analysis using lists in Python. It explains how to open the file, split the data, store it in an empty list as "float", and plot it and obtain statistical information.

Translated by

ScribdTranslations
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views5 pages

Data Analysis in Python: Reading Files

This document presents a solution for reading numeric data from a text file and converting it to floating point numbers ("float") for analysis using lists in Python. It explains how to open the file, split the data, store it in an empty list as "float", and plot it and obtain statistical information.

Translated by

ScribdTranslations
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Data analysis in python (files)

April 21, 2014

Through a mini tutorial, I will try to explain how to read numerical data from a
files ".txt" and convert them to "float" to work with them using lists.

Context:

While working on my thesis project about cyclic load analysis through the
use of a machine and an associated system to measure pressures through a
sensor, I came across the dilemma of finding a way to work with the
huge amount of data that were delivered by that sensor (on the order of 2 to
10 million data points). The first thing that came to my mind was Excel, however I
I realized that I had an enormous amount of scripts created in Python that I
allowed me to obtain the information that I truly needed for my study.
I finally finished transforming the scripts I needed into functions and it
the only thing that separated me from my goal was reading, transforming, and analyzing the
information that was in a notepad file. After searching and reading
I ended up finding (through trial and error) a more or less solution.
simple.

Solution:

1 file address
2 entry=open("C:\Users\pattop\Desktop\[Link]")
3
4 File reading
c=[Link]()
5
6 data division
7 d=[Link]()
8
9 # empty list to store the data
10 datos=[]
11
transform the data into float and they can be worked on
12 foriind
13 [Link](float(i))
14
15

In this way, the data will remain in the eponymous list and with the properties
"float" to work with them using any function, in my case plotting using
matplotlib and obtaining statistical information. I will try to help with any inquiries.
although it is not my specialty.

Tools: Language python ninja IDE.

Comments:Leave a Comment »

Labels:languages, Programs, python


Categories :Uncategorized

The free alternative to AutoCAD


3092013

For those looking for a free option of a professional CAD software with
an interface that reminds us of the popular AutoCAD we have thanks to the
recognized French firm Dassault Systèmes (SolidWorks, Catia, etc.) to DraftSight.
This software has the same features as AutoCAD (without its
more advanced tools, mainly 3D) with an equally
friendly and with better performance for low-capacity computers
processing (what AutoDesk may have wanted to achieve with its LT versions)
along with its lightweight and ease of installation.

Introduction to DraftSight

To download, you can go to the page where the instructions are located.

Also for those who wish to learn more, the software has a channel.
from YouTube where there is a series of tutorials.

[Link]

ComentariosLeave a Comment »

Labels:CAD, DraftSight, Programs, Technology


Categories :Uncategorized

Granulometry in Python
2032013
A small script developed in the Python language to establish the
granulometric classification of a soil sample. This method consists of
primarily in passing soil particles through a series of sieves that
they retain a certain volume of the sample according to its diameter. As of the
results yield a graphical representation that assists in the process of
classification.

Here I leave the file for those who are starting to program in Python.
it is necessary to change the extension to .py or copy the code into the IDE).granulometry.

Code for the logarithmic graph in python (matplotlib).

1
2from matplotlib import pyplot
3
4 col1=[PA8, PA7, PA6, PA5, PA4, PA3, PA2, PA1]
col2=[A8, A7, A6, A5, A4, A3, A2, A1]
5
6
[Link](col2, col1, color='blue', lw=2)
7
8 logarithmic scale
9 [Link]('log')
10
11 statement that inverts the x axis
12 [Link]().invert_xaxis()
13
14 grid log on x-axis
[Link](True, which="minor", linestyle='-')
15
16 normal grid on the y-axis
17 [Link](True, linestyle='-')
18
19 [Link]()
20
Fortran is a programming language developed in 1957 whose name comes from the acronym of the words
It was the first high-level general-purpose language developed.
originally by IBM for scientific and engineering applications. Among many of its applications are
numerical weather prediction, finite element analysis, fluid dynamics, physics
computational, chemistry, etc.

You might also like