Linked Questions
25 questions linked to/from How to avoid pandas creating an index in a saved csv
3
votes
2
answers
3k
views
Remove index when writing a dataframe to tex file [duplicate]
I have a dataframe that i read using pd.ExcelFile()
Iam doing like :
xl = pd.ExcelFile('input.xlsx')
df = pd.parse()
latexFormat = df.to_latex()
Now i write latexFormatto a .tex file, by simply ...
0
votes
0
answers
2k
views
how to remove the index column in pandas? [duplicate]
In Pandas, when saving dataframe into csv file, there is always a index column showing row number, for example
how to get rid of this index? I try to use the below code and it didn't work.
df1=df....
-2
votes
2
answers
528
views
I am getting extra column while converting .csv file to .xlsx file in Python [duplicate]
The code below converts .csv file in C:/Path/ into .xlsx file. However, it creates an extra column when converted to .xlsx file. How can I delete that added extra column? Thank you very much.
import ...
0
votes
1
answer
317
views
Writing csv file - Python [duplicate]
I am writing a CSV file in python using the following line:
data.to_csv(mydata.csv)
Unfortunately, the output presents a useless column as follow:
Date median ori
0 2000年01月31日 0.159 ...
1
vote
1
answer
476
views
Concatenate 2 csv files using panda and not include row index [duplicate]
How do I concatenate 2 CSV files using panda such that the resulting CSV file doesn't have row indexes? See example below:
file1.csv
date type price amount
2017-...
0
votes
0
answers
315
views
There is an extra id column in dataFrame read from csv [duplicate]
I created a dataFrame and it's the output:
print(train_df)
author text
0 BernardHickey The Commmonwealth Bank of Australia (CBA) warn...
1 ...
0
votes
1
answer
147
views
Python Pandas .str.split() creates an extra column that can't be dropped [duplicate]
I'm using the pandas split function to create new columns from an existing one. All of that works fine and I get my expected columns created. The issue is that it is creating an additional column in ...
0
votes
3
answers
62
views
pandas concating two default-indexed dataframes [duplicate]
I have data like (simplified for the sake of example):
list = [
{
age: 1234,
val: 0.5,
val2: 0.2
},
{
age: 1234,
val: 0.2,
val2: 0.8
},
]
I create pandas ...
1
vote
0
answers
68
views
Pandas dataframe updating with .loc adds columns and indexes [duplicate]
So I'm trying to create a software which uses a csv database with pandas for users. I'm not using indexes. My problem is that when I'm trying to update a cell for example: 'Adress' label, it works ...
1
vote
0
answers
52
views
remove row index from a dataframe [duplicate]
I have following dataframe named 'df'
h w x y
5 21.0 208.0 7.0 270.0
20 34.0 209.0 0.0 158.0
I want to get a single cell out of this dataframe. Forthat I did:
X=df.x
...
0
votes
0
answers
46
views
How to delete default column from data frame [duplicate]
I Have loaded a dataframe from excel data sheet.
df = pd.DataFrame(....)
df
A B C D
0 0 1 2 3
1 4 5 6 7
2 8 9 10 11
I need to send the filtered data over email to users, so ...
11
votes
1
answer
12k
views
additional column when saving pandas data frame to csv file
Here the the code to process and save csv file, and raw input csv file and output csv file, using pandas on Python 2.7 and wondering why there is an additional column at the beginning when saving the ...
1
vote
1
answer
2k
views
How to stop pandas from creating new column?
I have a csv file of fish occurrences and need to trim out any fish that show up only once, and then output this as a 'trimmed' csv. However, the function I am using adds a headerless column to the ...
1
vote
1
answer
1k
views
why do I get a row as header like [0, 1, 2, ...] when writing an excel file in python? [duplicate]
I have imported an excel file, changed B1 and exported it, but I don't want to have a row (the first row) as a Header. I would like to write my data in the first row of my DataFrame exactly in the row ...