#๐Ÿ”’ i need to put

42 messages ยท Page 1 of 1 (latest)

rigid phoenix
#

i have two sheets
the first row become the title of my columns
the second row went to the end when i merged
i need to put the second as a subtitle or do i need to delete?

warm briarBOT
#

@rigid phoenix

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

full mango
#

look at the dataframes after you create them:

#

print(caraterizado.head())

rigid phoenix
#

you mean this?

full mango
#

Your excel sheet has two header rows. You want to clean up either the excel or the dataframe. Probably by removing or ignoring the extra row.

rigid phoenix
#

so do i need to delete this row?

full mango
rigid phoenix
#

so do i just remove them?

#

i will do that then

#

juncao2 = juncao.drop(juncao.index[1556])
juncao2

so i do that?

full mango
#

or, juncao2=juncao[1:]

hot grotto
#

technically pandas supports multiindex columns, so you could preserve it, but I'd recommend just getting rid of either of the first two rows

full mango
#

hmm, no not juncao.

#

I'd drop them from cataerizacao and the other df. But, whatever you want.

rigid phoenix
full mango
#

or like etrotta said, if you really need the title and subtitle, you can multiindex it or concat them... but I don't think you need it for this problem

rigid phoenix
#

okay

#

i will delete then

hot grotto
#

use pd.read_excel(..., skiprows=1)

rigid phoenix
#

the subtitle its in 1556 row

#

because i merged

#

the first column its the HASHTAG (id)
for the two sheets, datas

so i merged by ID

#

and the subtitle went to the 1556

hot grotto
#

fix it before merging bruh

#

whatever you are doing, make sure you always keep a copy of the original data and the code needed to reproduce your results

rigid phoenix
#

thanks guys

rigid phoenix
#

juncao2 = juncao.drop(juncao.index[1556])

full mango
#

If it's the first row, then [1:] will exclude it

rigid phoenix
#

oooooooooooooooooooooh

#

this make sense

#

cool

#

thanks so much bobby and etrotta

rigid phoenix
#

i will delete, thats it

#

(you can close this thread)

warm briarBOT
#
Python help channel closed for inactivity

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.