Python Forum
Searching a .txt file for a specific number and extracting the corresponding data
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Searching a .txt file for a specific number and extracting the corresponding data
#4
(Jul-26-2018, 08:34 PM)Vysero Wrote: Can you show the code you have so far?
import numpy as np
import matplotlib.pyplot as plt

data_file1 = np.loadtxt('untitled.txt',delimiter='\t')     
p = data_file1[:,][:,0]              
t = data_file1[:,][:,1]      

plt.figure(1)
plt.rcParams['figure.figsize'] = [50, 50]
plt.plot(p, t,'c')
plt.xlabel('Periodicity [microns]')
plt.ylabel('Transmission')
plt.savefig('XRectangle.png')        # Saves the plot
Reply


Messages In This Thread
RE: Searching a .txt file for a specific number and extracting the corresponding data - by nrozman - Jul-27-2018, 02:07 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Sorting data by specific variables using argparse Bearinabox 5 1,434 Jan-01-2023, 07:44 PM
Last Post: Bearinabox
  Training a model to identify specific SMS types and extract relevant data? lord_of_cinder 0 986 Oct-10-2022, 04:35 AM
Last Post: lord_of_cinder
  Split excel file and write output at specific row and set sheet position DSCA 0 2,008 May-12-2022, 07:29 PM
Last Post: DSCA
  Searching Module to plot large data G_rizzle 0 1,459 Dec-06-2021, 08:00 AM
Last Post: G_rizzle
  extracting sublist from a large multiple molecular file juliocollm 2 2,316 May-25-2020, 12:49 PM
Last Post: juliocollm
  Import Excel File that Starts with Number kiki1113 1 3,327 Dec-20-2018, 07:13 PM
Last Post: Larz60+
  Extracting specific columns in an array uthongam 1 2,171 Dec-07-2018, 06:06 PM
Last Post: ichabod801
  Write specific rows from pandas dataframe to csv file pradeepkumarbe 3 5,539 Oct-18-2018, 09:33 PM
Last Post: volcano63
  extracting XML data into datframe hey_arnold 2 2,819 Jul-29-2018, 04:48 PM
Last Post: hey_arnold
  How to filter specific rows from large data file Ariane 7 8,252 Jun-29-2018, 02:43 PM
Last Post: gontajones

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020