GithubHelp home page GithubHelp logo

Comments (5)

Anurag-Varma avatar Anurag-Varma commented on July 30, 2024 1

@hyleepp

Or else you can use :

import pandas as pd

# Specify the path to your CSV file
file_path = 'test.csv'

# Read the file using tab as the separator
df = pd.read_csv(file_path, delimiter='t', header=None, escapechar='\\')

# Display the dataframe
print(df)

Output:

    0  1
0  "\  a

from pandas.

Anurag-Varma avatar Anurag-Varma commented on July 30, 2024

The data line which you gave is "\""\t"a"

But the image in issue description has different text.

Can you give exactly what should be present, and here does data mean its a path to a .csv file, cause you didn't describe the issue properly ?

from pandas.

hyleepp avatar hyleepp commented on July 30, 2024

Iā€™m sorry for my unclear expression.

  1. The actual data is still "\""\t"a" like the below image. The image in the first comment is meant to show that pd does not separated into two elements as expected.
    image
  2. Yes, data means a path to a .csv file that contains the given line.

from pandas.

Anurag-Varma avatar Anurag-Varma commented on July 30, 2024

This works when you have the data inside .csv to be in the format of:
"\"" "a"

But fails for "\""\t"a"

I think using the separator \t checks for tab spaces and not for the same exact \t separator

from pandas.

Anurag-Varma avatar Anurag-Varma commented on July 30, 2024

take

from pandas.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.