Python Forum
Sorting columns from text file help
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sorting columns from text file help
#2
(Nov-15-2019, 05:10 PM)nickglobal101 Wrote: The CODE I tried:

df = pd.read_csv('columns_test.txt', names=['Date','Num1','Num2'], skiprows=1, sep='\s+', engine='python')
df

Hi!

Have you tried this?:

df = pd.read_csv('columns_test.txt', names=['Weekday','Date','Num1','Num2'], skiprows=1, sep='\s+', engine='python')
df
All the best,
newbieAuggie2019

"That's been one of my mantras - focus and simplicity. Simple can be harder than complex: You have to work hard to get your thinking clean to make it simple. But it's worth it in the end because once you get there, you can move mountains."
Steve Jobs
Reply


Messages In This Thread
RE: Sorting columns from text file help - by newbieAuggie2019 - Nov-15-2019, 07:05 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Create Choices from .ods file columns cspower 3 602 Dec-28-2023, 09:59 PM
Last Post: deanhystad
  Create csv file with 4 columns for process mining thomaskissas33 3 753 Nov-06-2023, 09:36 PM
Last Post: deanhystad
  Converting a json file to a dataframe with rows and columns eyavuz21 13 4,463 Jan-29-2023, 03:59 PM
Last Post: eyavuz21
Thumbs Up Need to compare the Excel file name with a directory text file. veeran1991 1 1,124 Dec-15-2022, 04:32 PM
Last Post: Larz60+
  deleting columns in CSV file astral_travel 8 2,356 Nov-26-2022, 09:36 PM
Last Post: astral_travel
  Check DataFrames with different sorting in columns and rows Foxyskippy 0 778 Nov-19-2022, 07:49 AM
Last Post: Foxyskippy
  Replace columns indexes reading a XSLX file Larry1888 2 989 Nov-18-2022, 10:16 PM
Last Post: Pedroski55
  Modify values in XML file by data from text file (without parsing) Paqqno 2 1,673 Apr-13-2022, 06:02 AM
Last Post: Paqqno
  Converted Pipe Delimited text file to CSV file atomxkai 4 6,980 Feb-11-2022, 12:38 AM
Last Post: atomxkai
  rows from sql query need to write to a file as columns sjcsvatt 6 2,392 Oct-09-2021, 12:45 AM
Last Post: snippsat

Forum Jump:

User Panel Messages

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